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
i = 25;switch (i) {case 25: printf("The value is 25 ");case 30: printf("The value is 30 "); When the above statements are executed the output will be : a) The value is 25 b) The value is 30 c) The value is 25 The value is 30 d) none
How can I remove the leading spaces from a string?
What are different types of pointers?
What does %d do in c?
Write a program to find the biggest number of three numbers in c?
What are structure members?
Describe how arrays can be passed to a user defined function
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference
please can any one suggest me best useful video tutorials on c i am science graduate.please help me.u can email me to sas29@in.com
how to make a scientific calculater ?
Is fortran faster than c?
What is the condition that is applied with ?: Operator?
How do you define a string?
i got 75% in all semester am i eligible for your company
.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }