#include <stdio.h>
int main()
{
int arry[10]={25,56,25,2,3,4,7,7,9,10};
int *ptr;
ptr = &arry[0];
ptr++;
ptr++;
printf("the value of element is %d",*ptr);
return 0;
}
#include <stdio.h>
int main()
{
int array[10];
int *ptr;
ptr = array;
ptr = ptr + 2;
if (ptr == &array[2])
{
printf("the pointer point to same add");
}
else
{
printf("the pointer doesn't point to same add");
}
return 0;
}
#include <stdio.h>
int main()
{
int s[3];
printf("the value is %d",*(s+0));
return 0;
}
# include<stdio.h>
int main(){
int mul[10];
for (int i = 0; i < 10; i++)
{
mul[i]=5*(i+1);
}
for (int i = 0; i < 10; i++)
{
printf("5*%d=%d\n",i+1,mul[i]);
}
return 0;
}
#include <stdio.h>
int main()
{
int number;
printf("Enter the value of table U want?:");
scanf("%d", &number);
int mul[10];
for (int i = 0; i < 10; i++)
{
mul[i] = number * (i + 1);
}
for (int i = 0; i < 10; i++)
{
printf("the value of table %d * %d = %d \n", number, (i + 1), mul[i]);
}
return 0;
}
#include <stdio.h>
void reverse(int *array, int n)
{
int temp;
for (int i = 0; i <( n / 2); i++)
{
temp = array[i];
array[i] = array[n - i - 1];
array[n - i - 1] = temp;
}
}
int main()
{
int array[7] = {1, 2, 3, 4, 5, 6, 7};
reverse(array, 7);
for (int i = 0; i < 7 ; i++)
{
printf("the value is %d\n",array[i]);
}
return 0;
}
# include<stdio.h>
void count(int *arr,int n){
}
int main(){
int arr[10];
count(arr,10);
return 0;
}
#include <stdio.h>
int main()
{
int i,j;
int mul[3][10];
for (i = 0; i < 3; i++)
{
for ( j = 0; j< 10; i++)
{
mul[i][j]=2*(j+1);
mul[i][j]=7*(j+1);
mul[i][j]=9*(j+1);
}
}
for (i = 0; i < 3; i++)
{
for ( j = 0; j< 10; i++)
{
printf("the value of %d *%d = %d \t \t ",2,(j+1),mul[i][j]);
printf("the value of %d *%d = %d \t \t ",7,(j+1),mul[i][j]);
printf("the value of %d *%d = %d \t \t ",9,(j+1),mul[i][j]);
}
}
return 0;
}
#include <stdio.h>
int main()
{
int marks[3][3];
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
printf("Enter the marks of student %d and subject %d:", i + 1, j + 1);
scanf("%d", &marks[i][j]);
}
}
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
printf("the marks is %d \n",marks[i][j]);
}
}
return 0;
}
# include<stdio.h>
int main(){
int marks[4];
for (int i = 0; i < 5; i++)
{
printf("Enter the marks of students %d:",i+1);
scanf("%d",&marks[i]);
}
for (int i = 0; i < 5; i++)
{
printf(" the value of marks is : %d \n",marks[i]);
}
return 0;
}
#include <stdio.h>
int main()
{
int array[] = {25, 65, 78, 95, 200};
int *ptr;
// ptr = array[0];
ptr= array;
for (int i = 0; i < 5; i++)
{
printf("the value of elments %d is %d \n",i+1,*(ptr+i));
}
return 0;
}
#include <stdio.h>
int main()
{
int arry[]={25,65,85,98,748};
for (int i = 0; i < 5; i++)
{
printf("the value of element %d is %d \n",i+1,arry[i]);
}
return 0;
}
#include <stdio.h>
int main()
{
int marks[4];
printf("Enter the marks of students:");
scanf("%d",&marks[0]);
printf("Enter the marks of students:");
scanf("%d",&marks[1]);
printf("Enter the marks of students:");
scanf("%d",&marks[2]);
printf("Enter the marks of students:");
scanf("%d",&marks[3]);
printf("Enter the marks of students:");
scanf("%d",&marks[4]);
printf("You have Entered the marks %d %d %d and %d ",marks[0],marks[1],marks[2],marks[3],marks[4]);
return 0;
}
#include <stdio.h>
int main()
{
int arr[3][2];
return 0;
}
#include <stdio.h>
int main()
{
int arr[3][4][5];
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 4; j++)
{
for (int k = 0; k < 5; k++)
{
printf("the add of arr[%d][%d][%d] is %d \n",i,j,k,&arr[i][j][k]);
}
}
}
return 0;
}
#include <stdio.h>
int main()
{
int marks[5];
int *ptr;
ptr=marks;
for (int i = 0; i < 5; i++)
{
printf("Enter the marks of student %d :\n",i+1);
scanf("%d",ptr);
ptr++;
}
for (int i = 0; i < 5; i++)
{
printf("the marks of student %d : %d \n",i+1,marks[i]);
}
return 0;
}
#include <stdio.h>
void printarr(int ptr[], int n)
{
for (int i = 0; i < n; i++)
{
printf("the value of elemnts %d is %d \n", i + 1, ptr[i]);
}
ptr[2] = 520;
}
int main()
{
int arr[5] = {1, 2, 3, 4, 5};
printarr(arr, 5);
printf("%d", arr[2]);
printarr(arr, 5);
return 0;
}
#include <stdio.h>
int main()
{
int marks[4];
printf("Enter the marks of student 1:");
scanf("%d",&marks[0]);
printf("Enter the marks of student 2:");
scanf("%d",&marks[1]);
printf("Enter the marks of student 3:");
scanf("%d",&marks[2]);
printf("Enter the marks of student 4:");
scanf("%d",&marks[3]);
printf("The marks of students is %d %d %d and %d",marks[0],
marks[1],marks[2],marks[3]);
return 0;
}
#include <stdio.h>
void printTable(int *mulTable, int num, int n)
{
printf("the multiplication table of %d \n ", num);
for (int i = 0; i < n; i++)
{
mulTable[i] = num * (i + 1);
}
for (int i = 0; i < n; i++)
{
printf("%d*%d=%d\n", num, (i + 1), mulTable[i]);
}
printf("*****************************************\n \n ");
}
int main()
{
int mulTable[3][10];
printTable(mulTable[0], 2, 10);
printTable(mulTable[1], 7, 10);
printTable(mulTable[2], 9, 10);
return 0;
}
#include <stdio.h>
int main()
{
int n_student;
int n_subject;
printf("Enter the no of student:");
scanf("%d", &n_student);
printf("Enter the no of subject:");
scanf("%d", &n_subject);
int marks[n_student][n_subject];
for (int i = 0; i < n_student; i++)
{
for (int j = 0; j < n_subject; j++)
{
printf("Enter the marks of student %d in subject %d:", i + 1, j + 1);
scanf("%d",&marks[i][j]);
}
}
for (int i = 0; i < n_student; i++)
{
for (int j = 0; j < n_subject; j++)
{
printf("the marks of student %d in subject %d:%d\n", i + 1, j + 1,marks[i][j]);
}
}
return 0;
}
#include <stdio.h>
void positiveCount(int ptr[], int n)
{
int n_integer = 0;
for (int i = 0; i < n; i++)
{
if (ptr[i] > 0)
{
n_integer++;
}
}
printf("No . of Positive integers are %d", n_integer);
}
int main()
{
int arr[16] = {-1, -2, -3, 0, 1, 2, 3, 4, 5, 6,-4,-5,54,-56,96,-85};
positiveCount(arr, 16);
return 0;
}
#include <stdio.h>
void printTable(int *mulTable, int num, int n)
{
for (int i = 0; i < n; i++)
{
mulTable[i] = num * (i + 1);
}
for (int i = 0; i < n; i++)
{
printf("%d*%d=%d \n", num, (i + 1), mulTable[i]);
}
}
int main()
{
int m, n, num;
printf("Enter the m rows :\n");
scanf("%d", &m);
printf("Enter the n column :\n");
scanf("%d", &n);
int mulTable[m][n];
printf("Enter the which munber Table U want:\n");
scanf("%d", &num);
for (int i = 0; i < m; i++)
{
printTable(mulTable[m], num, n);
printf("Enter the which number Table U want:\n");
scanf("%d", &num);
}
return 0;
}
#include <stdio.h>
int main()
{
int arr[3];
int *ptr;
ptr = arr;
if (ptr == arr)
{
printf("the add lies in same add \n");
}
else
{
printf("the add lies in diff add");
}
return 0;
}
#include <stdio.h>
int main()
{
int marks[5];
for (int i = 0; i < 5; i++)
{
printf("Enter the marks of student %d :", i + 1);
scanf("%d", &marks[i]);
}
for (int i = 0; i < 5; i++)
{
printf("the marks of student %d is %d \n", i + 1, marks[i]);
}
return 0;
}
# include<stdio.h>
void reverse(int *arr,int n){
int temp;
for (int i = 0; i < (n/2); i++)
{
temp=arr[i];
arr[i]=arr[n-i-1];
arr[n-i-1]=temp;
}
}
int main(){
int arr[7]={1,2,3,5,6,7,8};
reverse(arr,7);
for (int i = 0; i <7; i++)
{
printf("the value is %d \n",arr[i]);
}
return 0;
}
No comments:
Post a Comment