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

What are the 4 data types?

0 Answers  


Explain following declaration int *P(void); and int (*p)(char *a);

3 Answers  


What is openmp in c?

0 Answers  


What are volatile variables in c?

0 Answers  


what is the difference between : func (int list[], ...) or func (int *list , ....) - what is the difference if list is an array and if also if list is a pointer

2 Answers  






string reverse using recursion

0 Answers   Mind Tree,


which operator having lowest precedence?? a.)+ b.)++ c.)= d.)%

4 Answers  


Explain how do you override a defined macro?

0 Answers  


change to postfix a/(b+c*d-e)

8 Answers   Value Labs,


How can you draw circles in C?

0 Answers   Accenture,


a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler

0 Answers  


What is zero based addressing?

0 Answers  


Categories