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
What is cohesion and coupling in c?
What is meant by realloc()?
Can you think of a logic behind the game minesweeper.
The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?
how to write optimum code to divide a 50 digit number with a 25 digit number??
What is difference between union All statement and Union?
What is volatile variable how do you declare it?
write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
How do you generate random numbers in C?
Subtract Two Number Without Using Subtraction Operator
What is hashing in c language?
1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321
what do you mean by enumeration constant?
How can I manipulate individual bits?