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

which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above

0 Answers  


write a c programming using command line argument,demonstrate set operation(eg;union,intersection,difference) example output is c:>setop 12 34 45 1 union 34 42 66 c:>setop 12 34 1 42 66 c:>setop 12 34 diff 12 56 67 78 setop 12 34

0 Answers  


write a c program to print the next of a particular no without using the arithmetic operator or looping statements?

1 Answers   TCS,


what is linkage error when it occurs in c program

3 Answers  


what is the difference between postfix and prefix unary increment operators?

3 Answers  






Is main() is used in the program,,see below example? void main() { int i; for(i=0;i<10;i++) main(); } Then what is the output of the program?

6 Answers  


Explain two-dimensional array.

0 Answers  


typedef struct { int i:8; char c:9; float f:20; }st_temp; int getdata(st_temp *stptr) { stptr->i = 99; return stptr->i; } main() { st_temp local; int i; local.c = 'v'; local.i = 9; local.f = 23.65; printf(" %d %c %f",local.i,local.c,local.f); i = getdata(&local); printf("\n %d",i); getch(); } why there there is an error during compiling the above program?

1 Answers  


write a program to swap Two numbers without using temp variable.

75 Answers   EMC, Focus, GreyB, HCL, Hitech, HP, Huawei, Infosys, Mannar Company, Microsoft, Miles Software, Odessa Technologies, Satyam, TCS, Wipro,


related proverb of "dont count your chicken before it hatches"

1 Answers  


What is p in text message?

0 Answers  


How to convert decimal to binary in C using recursion??

4 Answers   HP, IBM,


Categories