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

How many types of functions are there in c?

1152


What is the difference between NULL and NUL?

1308


What's the difference between constant char *p and char * constant p?

1154


Explain how can you check to see whether a symbol is defined?

1214


What is the difference between abs() and fabs() functions?

1137


How are strings stored in c?

1027


what do the 'c' and 'v' in argc and argv stand for?

1176


Explain zero based addressing.

1042


I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.

2376


If fflush wont work, what can I use to flush input?

1106


What is the difference between memcpy and memmove?

1043


What are the disadvantages of a shell structure?

1357


What are the different data types in C?

1210


Where we use clrscr in c?

1141


How is a null pointer different from a dangling pointer?

1041