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

Is array name a pointer?

1028


Can you please explain the difference between malloc() and calloc() function?

1120


Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

1216


What is difference between structure and union in c?

987


How can I call fortran?

1039


What is header file definition?

1080


What does c in a circle mean?

1073


What functions are in conio h?

1184


How can I get back to the interactive keyboard if stdin is redirected?

1188


What is the use of a static variable in c?

1059


Explain null pointer.

1109


Explain the difference between exit() and _exit() function?

1167


What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?

1275


Differentiate between ordinary variable and pointer in c.

1176


What are two dimensional arrays alternatively called as?

1177