write a C code
to reverse a string using a recursive function, without
swapping or using an extra memory.
Answer Posted / sanny
#include<stdio.h>
#include<conio.h>
main()
{
int num, rem=0;
printf("\n Enter the number ");
scanf("%d", &num);
while(num>0)
{
rem = (rem * 10) + (num % 10);
num = num / 10;
}
printf("\n Reverse of the number is %d", rem);
getch();
}
| Is This Answer Correct ? | 10 Yes | 15 No |
Post New Answer View All Answers
What is ## preprocessor operator in c?
What is non linear data structure in c?
Can we access the array using a pointer in c language?
What is a shell structure examples?
Which of these functions is safer to use : fgets(), gets()? Why?
What is const volatile variable in c?
code for replace tabs with equivalent number of blanks
What is this infamous null pointer, anyway?
Is r written in c?
Can the size of an array be declared at runtime?
Explain Function Pointer?
What is const keyword in c?
Can we compile a program without main() function?
What are the advantages of using linked list for tree construction?
What is difference between union and structure in c?