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 main an identifier in c?
where are auto variables stored? What are the characteristics of an auto variable?
Write a program of prime number using recursion.
Why is event driven programming or procedural programming, better within specific scenario?
Why c is called object oriented language?
What is the return type of sizeof?
Define recursion in c.
What are the ways to a null pointer can use in c programming language?
In c programming, explain how do you insert quote characters (? And ?) Into the output screen?
Why does this code crash?
Tell me what is null pointer in c?
How can a process change an environment variable in its caller?
What are structure types in C?
How can I implement sets or arrays of bits?
Write a factorial program using C.