write C code to reverse a string such that if i/p is "abc
defg hij klmno pqrs tuv wxyz"
and the o/p should be "cba gfed jih onmlk srqp vut zyxw"
Answer Posted / naresh
man()
{
char ch[33];
printf("enter the string");
for(int i=0;i<33;i++)
scanf("%c",&ch[i]);
int k=0;
for(i=0;ch[i]!='/o';i++)
{
if(ch[i]==" ")
{ int n=i;
while(i>=k)
{
printf("%c",ch[i]);
i--;
}
k=n;
}
}
}
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
What will be the outcome of the following conditional statement if the value of variable s is 10?
What is the use of define in c?
Do you know the difference between exit() and _exit() function in c?
What do you understand by normalization of pointers?
What does *p++ do?
What is difference between far and near pointers?
What are the various types of control structures in programming?
If fflush wont work, what can I use to flush input?
What is sizeof c?
How do you construct an increment statement or decrement statement in C?
What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?
What is the use of gets and puts?
What is a char c?
How can I implement a delay, or time a users response, with sub-second resolution?
Why c is called object oriented language?