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 a stream water?
Explain how can you tell whether two strings are the same?
WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.
What is hash table in c?
What is a newline escape sequence?
Badboy is defined who has ALL the following properties: Does not have a girlfriend and is not married. He is not more than 23 years old. The middle name should be "Singh" The last name should have more than 4 characters. The character 'a' should appear in the last name at least two times. The name of one of his brothers should be "Ram" Write a method: boolean isBadBoy(boolean hasGirlFriend , boolean isMarried, int age , String middleName , String lastName , String[] brotherName); isHaveGirlFriend is true if the person has a girlfriend isMarried is true if the person is married age is the age of the person middleName is the middle name of the person lastName is the last name of the person brotherName is the array of the names of his brothers
What is int main () in c?
What is the value of a[3] if integer a[] = {5,4,3,2,1}?
What functions are in conio h?
What does int main () mean?
What is volatile variable in c?
program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)
Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.
What is a pointer and how it is initialized?
Which of these functions is safer to use : fgets(), gets()? Why?