Answer Posted / atul kumar rai
#include<stdio.h>
#include<conio.h>
#include<string.h>
int main()
{
char str[100],temp1;
int i,j,len,temp;
printf("Enter any string : ");
gets(str);
len=strlen(str);
for(i=0,j=len-1;i<j;i++,j--)
{
temp1=str[i];
str[i]=str[j];
str[j]=temp1;
}
for(i=0; str[i]!=NULL; i++)
{
if(str[i+1]==' ' || str[i+1]==NULL)
{
for(temp=i; temp>=0 && str[temp]!=' '; temp--)
printf("%c",str[temp]);
printf(" ");
}
}
getch();
return 0;
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Write a program to reverse a given number in c?
Can we add pointers together?
what is the structure pointer?
How to establish connection with oracle database software from c language?
Is there a built-in function in C that can be used for sorting data?
in iso what are the common technological language?
How do you determine the length of a string value that was stored in a variable?
cavium networks written test pattern ..
Can stdout be forced to print somewhere other than the screen?
Tell me when would you use a pointer to a function?
What is the use of a conditional inclusion statement in C?
How can I get back to the interactive keyboard if stdin is redirected?
What is class and object in c?
What are the benefits of organizational structure?
What is the advantage of using #define to declare a constant?