PROGRAM TO SORT WORDS ALPHABETICALLY

/*PROGRAM TO SORT WORDS ALPHABETICALLY*/ #include<stdio.h> #include<conio.h> void main() { char a[10][20],temp[20]; int i,n,j; clrscr(); printf(“Enter the size of array: “); scanf(“%d”,&n); printf(“Enter elements in the array:\n”); for(i=0;i<n;i++) { scanf(“%s”,a[i]); …

PROGRAM TO COPY ONE STRING INTO ANOTHER STRING

/*PROGRAM TO COPY ONE STRING INTO ANOTHER STRING*/ #include<stdio.h> #include<conio.h> void main() { int i=0; char a[10],b[10]; clrscr(); printf(“Enter any string: “); gets(a); printf(“Before copying string is: “); puts(a); while(a[i]!=’\0′) …

PROGRAM TO FIND WHETHER A STRING IS PALINDROME OR NOT

/*PROGRAM TO FIND WHETHER A STRING IS PALINDROME OR NOT*/ #include<stdio.h> #include<conio.h> void main() { char a[15]; int length,i,count=0,j; clrscr(); printf(“Enter any string: “); gets(a); length=strlen(a); j=length-1; for(i=0;i<length;i++,j–) { if(a[i]==a[j]) …

PROGRAM TO SHOW INPUT AND OUTPUT OF A STRING

/*PROGRAM TO SHOW INPUT AND OUTPUT OF A STRING*/ #include<stdio.h> #include<conio.h> void main() { char a[15]; clrscr(); printf(“Enter any string: “); gets(a); printf(“Inputted string is: “); puts(a); getch(); }

PROGRAM TO SEARCH AN ELEMENT IN THE MATRIX

/*PROGRAM TO SEARCH AN ELEMENT IN THE MATRIX*/ #include<stdio.h> #include<conio.h> void main() { int m,n,i,j,srch,count=0,a[5][5]; clrscr(); printf(“Enter the order of matrix: “); scanf(“%d%d”,&m,&n); printf(“Enter %d elements in the matrix:\n”,m*n); for(i=0;i<m;i++) …