C-programming - Program to find largest word, C coding to find largest word
Program to find largest word
#include<stdio.h> #include<conio.h> void main() { int w=0,i=0,j=0,l,a[10],big; char ch[25],st[10][20]; clrscr(); printf("Enter the string:"); gets(ch); while(ch[i]!='\0') { if(ch[i]==' ') { st[w][j]='\0'; a[w]=j; j=0; w++; } else { st[w][j]=ch[i]; i++; } i++; } big=l=0; for(i=0;i<w;i++) { if(big<a[i]) { big=a[i]; l=i; } } printf("The longest word is %s",st[1]); getch(); }
The topic on C-programming - Program to find largest word is posted by - Math
Hope you have enjoyed, C-programming - Program to find largest wordThanks for your time