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

Is there a built-in function in C that can be used for sorting data?

0 Answers  


What are the commands should be given before weiting C Program i.e, Cd.. like

4 Answers   IBM, Infonet, Satyam, Tech Mahindra,


Difference between exit() and _exit() function?

0 Answers  


write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.

0 Answers   Subex,


Explain the properties of union.

0 Answers  






sir, i cannot find the way how to write aprogram by using array on queue

1 Answers   IISIT,


What is a const pointer?

0 Answers  


Explain Basic concepts of C language?

0 Answers   EXL,


How can I call a function, given its name as a string?

4 Answers   ABC Telecom,


Is int a keyword in c?

0 Answers  


Who developed c language and when?

0 Answers  


what is constant pointer?

3 Answers  


Categories