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
Is array name a pointer?
Can you please explain the difference between malloc() and calloc() function?
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
What is difference between structure and union in c?
How can I call fortran?
What is header file definition?
What does c in a circle mean?
What functions are in conio h?
How can I get back to the interactive keyboard if stdin is redirected?
What is the use of a static variable in c?
Explain null pointer.
Explain the difference between exit() and _exit() function?
What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?
Differentiate between ordinary variable and pointer in c.
What are two dimensional arrays alternatively called as?