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"
Answer Posted / 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 |
Post New Answer View All Answers
Explain what is a pragma?
Is it possible to use curly brackets ({}) to enclose single line code in c program?
What are the 5 types of organizational structures?
What is omp_num_threads?
general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only
What is the newline escape sequence?
Write a program to know whether the input number is an armstrong number.
How can I run c program?
What are header files why are they important?
What is keyword with example?
What is the use of getchar() function?
Explain how do you sort filenames in a directory?
When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd
What is include directive in c?
Write a C program in Fibonacci series.