बिजनेस मार्केटिंग का लो कॉस्ट फंडा , अपने मोबाइल से ऑटो sms भेजकर मार्केटिंग करे विजिट करे http://autotextsms.com/ बिजनेस मार्केटिंग का लो कॉस्ट फंडा http://autotextsms.com/

Search This Blog

Translate

Showing posts with label C program to find largest word in a given string. Show all posts
Showing posts with label C program to find largest word in a given string. Show all posts

C program to find longest word in a given string

C program to find largest word in a given string,C program to find longest word in a given string,program to find longest palindrome in a string in c,c program to find the occurrence of word in string


C program to find longest word in a given string

#include
#include
#include
void main()
{
 char str[100];
 int length,i,start=0,end=0,j;
 int finalstart,finalend,count=0;
 clrscr();

 printf("Enter the string");
 gets(str);
 length=strlen(str);
 for(i=0;i { j=i;
   start=i;
   while(str[j]!=' '&&str[j]!='\0')
   {
   end=j;
   j++;
      }
      i=j;
      if(count      {
       count=end-start;
       finalstart=start;
       finalend=end;

      }
   }
  printf("\n longest word \n");
  for(i=finalstart;i<=finalend;i++)
  printf("%c",str[i]);
  getch();

}

C program to find largest word in a given string,C program to find longest word in a given string,program to find longest palindrome in a string in c,c program to find the occurrence of word in string

C Program example List