बिजनेस मार्केटिंग का लो कॉस्ट फंडा , अपने मोबाइल से ऑटो sms भेजकर मार्केटिंग करे विजिट करे http://autotextsms.com/ बिजनेस मार्केटिंग का लो कॉस्ट फंडा http://autotextsms.com/

Search This Blog

Translate

C Program example to reverse each world of given sentence

C Program to reverse each world of given sentence solve C Program to reverse each world of given sentence with source code, how to write c program to revers each world

#include
#include
void main()
{
char string[50],choice;
int i=0,j=0,k=0;
char temp[50];
clrscr();

printf("Enter String :");
gets(string);
printf("\n \n \t ") ;
while (string[i]!='\0')
{
//here we find spaces from string and store index of space in j
if (string[i]==' ')
{
j=i;
while(k<=i)
{
temp[k]=string[j--];
printf("%c",temp[k]);
k++;
}
}
i++;
}
//this is for word after space occur in string
if (string[i]=='\0')
{
j=i;
while(k<=i){
temp[k]=string[j--];
printf("%c",temp[k]);
k++;
}

}
getch();
}





C Program example List