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
Is c easier than java?
How to explain the final year project as a fresher please answer with sample project
Who invented b language?
What is the difference between NULL and NUL?
What is a #include preprocessor?
When is a null pointer used?
What is the difference between arrays and pointers?
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]
What is memcpy() function?
What is the difference between array and linked list in c?
What is the explanation for the dangling pointer in c?
Explain how does flowchart help in writing a program?
What is pointers in c?
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
What are the advantages of using linked list for tree construction?