Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Explain what are linked list?

1017


What is c definition?

1219


`write a program to display the recomended action depends on a color of trafic light using nested if statments

2095


what is the significance of static storage class specifier?

2205


Which built-in library function can be used to match a patter from the string?

1264


What is atoi and atof in c?

1051


Is it possible to initialize a variable at the time it was declared?

1197


How can I call a function with an argument list built up at run time?

1194


Can include files be nested? How many levels deep can include files be nested?

1112


c program for searching a student details among 10 student details

2062


In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none

1170


Explain how do you print only part of a string?

1181


How can I write a function that takes a format string and a variable number of arguments?

1014


What is keyword in c?

977


What is the explanation for prototype function in c?

942