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"

Answers were Sorted based on User's Feedback



write C code to reverse a string such that if i/p is "abc defg hij klmno pqrs tuv wxyz" ..

Answer / 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

write C code to reverse a string such that if i/p is "abc defg hij klmno pqrs tuv wxyz" ..

Answer / bipin chandra sai.s

hay just use concatenation of strings method
{
int temp=int a;
int a=int b;
int b=int temp;
}

Is This Answer Correct ?    2 Yes 6 No

Post New Answer

More C Interview Questions

Compare and contrast compilers from interpreters.

0 Answers  


what is the code for getting the output as * ** ***

5 Answers   Caritor,


Difference between Shallow copy and Deep copy?

0 Answers  


What is dynamic memory allocation?

0 Answers  


what is compiler

6 Answers  






why Language C is plateform dependent

3 Answers   Siemens, Wipro,


void main() { for(; 0 ;) ... { printf("hello"); ... } getch(); }

1 Answers  


Explain how do I determine whether a character is numeric, alphabetic, and so on?

0 Answers  


What is data types?

0 Answers  


advantages of pointers?

3 Answers  


What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file

0 Answers  


suppose there are five integers write a program to find larger among them without using if- else

2 Answers  


Categories