Write a C program that reads a series of strings and prints
only those ending in "ed"
Answer Posted / mani
#include<stdio.h>
main()
{
char *a[6]={"sayed","jhsdj","manvi","buged","error"};
int i,j,k,h;
int flag=0;
for(i=0;i<5;i++)
{
j=0;
j=strlen(a[i]);
if(*(a[i]+3)=='e'&& *(a[i]+4)=='d')
{
printf("%s\n",a[i]);
}
else
{
printf("no match\n");
}
}
}
| Is This Answer Correct ? | 11 Yes | 11 No |
Post New Answer View All Answers
Explain what are linked list?
What is c definition?
`write a program to display the recomended action depends on a color of trafic light using nested if statments
what is the significance of static storage class specifier?
Which built-in library function can be used to match a patter from the string?
What is atoi and atof in c?
Is it possible to initialize a variable at the time it was declared?
How can I call a function with an argument list built up at run time?
Can include files be nested? How many levels deep can include files be nested?
c program for searching a student details among 10 student details
In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none
Explain how do you print only part of a string?
How can I write a function that takes a format string and a variable number of arguments?
What is keyword in c?
What is the explanation for prototype function in c?