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
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
What is define directive?
What is meant by errors and debugging?
Where static variables are stored in c?
What is the difference between malloc calloc and realloc in c?
the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+....
what are the facialities provided by you after the selection of the student.
Differentiate between declaring a variable and defining a variable?
What is bubble sort technique in c?
How is a null pointer different from a dangling pointer?
What are header files and explain what are its uses in c programming?
Can you define which header file to include at compile time?
What is the g value paradox?
What are qualifiers and modifiers c?
What is a ternary operator in c?