Write a program in C to reverse a number by recursive
function?
Answer / sreejesh1987
int rev(int,int);
void main()
{
int a,b;
clrscr();
printf("\nEnter the number to reverse:");//456
scanf("%d",&a);
b=a%10;//b=6
printf("\nReverse of the number is: %d",rev(a,b));
getch();
}
int rev(int a,int b)
{
if(a>10)//456
{
a=a/10;//a=45
b=b*10+a%10;//65
return rev(a,b);
}
else
return b;
}
| Is This Answer Correct ? | 17 Yes | 7 No |
Is file a keyword in c?
#include<stdio.h> int main() { int a[3][3][2]= {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18}; printf("%d\n",*(*(*a+1)); return 0; } What will be the output of the above question? And how?
#include main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } }
Why do we use pointer to pointer in c?
why we are using float in C
Why is c used in embedded systems?
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above
How can I get the current date or time of day in a c program?
Explain 'bus error'?
What is a keyword?
What is a lookup table in c?
write a program to add two numbers of any size.....(remember any size)