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 static variables be declared in a header file?

1045


How can I dynamically allocate arrays?

1072


Is Exception handling possible in c language?

2034


what will be the output for the following main() { printf("hi" "hello"); }

10942


What is a spanning Tree?

1556


When is the “void” keyword used in a function?

1480


What is the most efficient way to store flag values?

1166


What is nested structure with example?

1055


What is pointer to pointer in c?

1098


Explain how can I convert a number to a string?

1139


Why is c called c not d or e?

1082


What is volatile variable in c?

1076


Give differences between - new and malloc() , delete and free() ?

1079


Write a code of a general series where the next element is the sum of last k terms.

1020


What are different storage class specifiers in c?

1076