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...

Reverse a string word by word??

Answer Posted / vishnu948923

#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<ctype.h>
void main()
{
int n,i,j=0;
char str[100];
char str1[100];
clrscr();
puts("Enter string:");
gets(str);
n=strlen(str);
for(i=n-1;i>=0;i--)
{
if(str[i]==' ')
{
str1[j]='\0';
strrev(str1);
printf("%s ",str1);
j=0;
}
else
{
str1[j++]=str[i];

}
}
if(i==-1)
{
str1[j]='\0';
strrev(str1);

printf("%s ",str1);
}
getch();
}

//strtoke
//isvowel

Is This Answer Correct ?    24 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you write the function prototype, definition and mention the other requirements.

1146


What is the purpose of & in scanf?

1079


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

1154


What is %g in c?

1085


Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result

1913


What are the types of macro formats?

1128


Why is event driven programming or procedural programming, better within specific scenario?

2447


Explain how many levels deep can include files be nested?

1083


What is an arrays?

1084


What does == mean in texting?

1317


Why is c used in embedded systems?

1129


How to draw the flowchart for structure programs?

9348


What is the best style for code layout in c?

1104


When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.

1991


Why is not a pointer null after calling free?

1031