Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write a C program that reads a series of strings and prints
only those ending in "ed"

Answer Posted / antony from chennai

void main()
{
char *s[10];
int n;
printf("No of strings:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%s",s[i]);
}
for(i=1;i<=n;i++)
{
int len;
len=strlen(*s[i]);
len=len-1;
if(*s[len]='e' && *s[len--]='d')
{
printf("%s",*s[i]);
}
else
{
printf("no match");
}
}
getch();
}
}

Is This Answer Correct ?    4 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why & is used in scanf in c?

1147


any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above

1104


if p is a string contained in a string?

1891


Can the sizeof operator be used to tell the size of an array passed to a function?

1177


What are different types of pointers?

1109


What do you mean by Recursion Function?

1181


Explain what is the difference between text files and binary files?

1221


What is break statement?

1182


How can I call fortran?

1101


explain what is a newline escape sequence?

1145


Is the exit() function same as the return statement? Explain.

1157


Why is c faster?

1185


cavium networks written test pattern ..

4142


When would you use a pointer to a function?

1102


What are the benefits of organizational structure?

1064