Shopping In MUMBAI

Are you searching for Discounts, offers, sale in Mumbai ? You are in the right place. MUMBAI, a shopping haven, has no dearth of great discounts and sales. This blog features the best MUMBAI shopping offers, sale, discounts and deals and bargains CURRENTLY GOING on in Mumbai plus a few free things thrown in on top. Don't wait for it because once they are gone, they are gone. Hurry!..By clicking the "Like" button you will receive a daily update of discounts, sale, offers going on in Mumbai. LIKE IT.... SHARE IT...njoY.

Monday, December 29, 2008

C Program to read a set of lines from stdin and print the longest line.

Program to read a set of lines from stdin and print the longest line.

#include
#include
#include
void main()
{
char s[20][80];
int i,j,k,l,n,max=0;
clrscr();
printf("How Many Lines You Want To Enter==");
scanf("%d",&n);
printf("\nEnter %d Lines,Lines Will End After Pressing Only Enter\n",n);
flushall();
for(i=0;i gets(s[i]);
j=0;
for(i=0;i {
l=strlen(s[i]);
if(l>max)
{
max=l;
j=i;
}
}
printf("\nLongest String Is \n");
printf("\n%s",s[j]);
getch();
}

C Program to read a set of lines from stdin and print the longest line.SocialTwist Tell-a-Friend

0 comments:

SUPPORT THIS BLOG