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

can we execute the program with the object file

1 Answers  


Hai friends im a i year student. i want to develop my knowledge in the field of TSR in c. How I'm Improve ?

2 Answers  


Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..

0 Answers   Huawei,


What are the back slash character constants or escape sequence charactersavailable in c?

0 Answers  


write a program to reverse the words in the sentence.NOTE:not reverse the entire string but just the occurance of each word

1 Answers   Sienna Ecad, Wipro,






Explain how can I read and write comma-delimited text?

0 Answers  


i want the code for printing the output as follows 4 4 3 3 2 2 1 1 0 1 1 2 2 3 3 4 4

2 Answers  


Is array name a pointer?

0 Answers  


How do you define a function?

0 Answers  


there is two conditions , 1. while using for loop for printing 1 to 50 no's simulteneous 2. while using printf functios for printing 1 to 50 no's simulteneous with or without using variables who will take more time for compiling and execution? explain in details with reason?

1 Answers  


how to make c program without a libary? e.g.#include<stdio.h> libary is not in c progaram.

2 Answers  


what will be the output: main(){char ch;int a=10;printf("%d",ch);}

36 Answers   Accenture, TCS, Wipro,


Categories