PROGRAM TO FIND REVERSE OF A NUMBER USING POINTER

//PROGRAM TO FIND REVERSE OF A NUMBER USING POINTER. #include<stdio.h> #include<conio.h> void main() { int n,a; int *rev,*rem,*temp; clrscr(); printf(“Enter any number: “); scanf(“%d”,&n); a=n; temp=&n; *rev=0; while(*temp>0) { *rem=*temp%10; …

PROGRAM TO ADD TWO NUMBERS USING POINTERS

/*PROGRAM TO ADD TWO NUMBERS USING POINTERS*/ #include<stdio.h> #include<conio.h> void main() { int a,b,c=0; int *m,*n; clrscr(); printf(“Enter any two numbers: “); scanf(“%d%d”,&a,&b); m=&a; n=&b; c=(*m)+(*n); printf(“Addition of two numbers …

PROGRAM TO PERFORM BINARY SEARCH

/*PROGRAM TO PERFORM BINARY SEARCH*/ #include<stdio.h> #include<conio.h> void main() { int n,srch,i,j,a[10],temp,high,low=0,mid=0; clrscr(); printf(“Enter the size of array: “); scanf(“%d”,&n); printf(“Enter %d elements in the array:\n”,n); for(i=0;i<n;i++) scanf(“%d”,&a[i]); /*SORTING STARTS*/ …

PROGRAM TO PERFORM LINEAR SEARCH

/*PROGRAM TO PERFORM LINEAR SEARCH*/ #include<stdio.h> #include<conio.h> void main() { int n,srch,i,count=0,a[10]; clrscr(); printf(“Enter the size of array: “); scanf(“%d”,&n); printf(“Enter %d elements in the array:\n”,n); for(i=0;i<n;i++) scanf(“%d”,&a[i]); printf(“Elements in …

PROGRAM TO SORT A GIVEN ARRAY USING SELECTION SORT

/*PROGRAM TO SORT A GIVEN ARRAY USING SELECTION SORT*/ #include<stdio.h> #include<conio.h> void main() { int n,i,j,a[10],temp; clrscr(); printf(“Enter the size of array: “); scanf(“%d”,&n); printf(“Enter %d elements in the array:\n”,n); …

PROGRAM TO SORT A GIVEN ARRAY USING BUBBLE SORT

/*PROGRAM TO SORT A GIVEN ARRAY USING BUBBLE SORT*/ #include<stdio.h> #include<conio.h> void main() { int n,i,j,a[10],temp; clrscr(); printf(“Enter the size of array: “); scanf(“%d”,&n); printf(“Enter %d elements in the array:\n”,n); …

PROGRAM TO ADD ELEMENTS OF A MATRIX USING RECURSION

/*PROGRAM TO ADD ELEMENTS OF A MATRIX USING RECURSION*/ #include<stdio.h> #include<conio.h> void add(int b[],int,int,int); void main() { int a[15][15],b[15],i,j,m,n,q,k,sum=0,l=0; clrscr(); printf(“Enter the order of matrix\n”); scanf(“%d%d”,&m,&n); if(m==0 || n==0) { …