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
What is zero based addressing?
If null and 0 are equivalent as null pointer constants, which should I use?
How to declare pointer variables?
What are global variables and explain how do you declare them?
What are volatile variables in c?
#include
p*=(++q)++*--p when p=q=1 while(q<=6)
What are the __date__ and __time__ preprocessor commands?
a program that can input number of records and can view it again the record
Explain 'bus error'?
What is character constants?
What does & mean in scanf?
How do you declare a variable that will hold string values?
What is a structural principle?
Is there any data type in c with variable size?