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 C code to reverse a string such that if i/p is "abc
defg hij klmno pqrs tuv wxyz"
and the o/p should be "cba gfed jih onmlk srqp vut zyxw"

Answer Posted / naresh

man()
{
char ch[33];
printf("enter the string");
for(int i=0;i<33;i++)
scanf("%c",&ch[i]);
int k=0;
for(i=0;ch[i]!='/o';i++)
{
if(ch[i]==" ")
{ int n=i;
while(i>=k)
{
printf("%c",ch[i]);
i--;
}
k=n;
}
}
}

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to get string length of given string in c?

1014


What are the advantage of c language?

1006


What is the meaning of c in c language?

1080


Can we declare variable anywhere in c?

925


What are lookup tables in c?

953


How can I invoke another program (a standalone executable, or an operating system command) from within a c program?

1135


Explain union. What are its advantages?

1010


What is #include stdio h?

1064


What is merge sort in c?

1004


What is a pointer and how it is initialized?

1085


What are the types of data types and explain?

1038


Do pointers store the address of value or the actual value of a variable?

1023


Can a variable be both static and volatile in c?

975


What does. int *x[](); means ?

1018


The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none

1196