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
Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
Hi can anyone tell what is a start up code?
WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER
What is return in c programming?
Can you please explain the difference between exit() and _exit() function?
What is malloc calloc and realloc in c?
Is a pointer a kind of array?
What do you mean by recursion in c?
What are logical errors and how does it differ from syntax errors?
How do you use a pointer to a function?
c program to compute AREA under integral
Difference between Shallow copy and Deep copy?
Explain about C function prototype?
Differentiate between declaring a variable and defining a variable?
Explain about the constants which help in debugging?