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

How can you avoid including a header more than once?

981


Here is a neat trick for checking whether two strings are equal

1017


What is the difference between int main and void main?

1045


What is a char c?

1043


program for reversing a selected line word by word when multiple lines are given without using strrev

2477


In a header file whether functions are declared or defined?

1126


Why is %d used in c?

1005


What is scope rule in c?

1060


What header files do I need in order to define the standard library functions I use?

1053


Ow can I insert or delete a line (or record) in the middle of a file?

1001


main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }

1152


What is difference between stdio h and conio h?

1368


What is difference between static and global variable in c?

1045


How would you obtain the current time and difference between two times?

1286


Explain how does flowchart help in writing a program?

1113