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
How many types of functions are there in c?
What is the difference between NULL and NUL?
What's the difference between constant char *p and char * constant p?
Explain how can you check to see whether a symbol is defined?
What is the difference between abs() and fabs() functions?
How are strings stored in c?
what do the 'c' and 'v' in argc and argv stand for?
Explain zero based addressing.
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.
If fflush wont work, what can I use to flush input?
What is the difference between memcpy and memmove?
What are the disadvantages of a shell structure?
What are the different data types in C?
Where we use clrscr in c?
How is a null pointer different from a dangling pointer?