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 |
what is the role you expect in software industry?
How can I increase the allowable number of simultaneously open files?
Explain about the constants which help in debugging?
Why ca not I do something like this?
write a proram to reverse the string using switch case?
what does the following function print? func(int i) { if(i%2)return 0; eale return 1; } main() { int =3; i=func(i); i=func(i); printf("%d",i);}
Write a C program that computes the value ex by using the formula ex =1+x/1!+x2/2!+x3+3!+………….
I didn't count the ducks that I saw in line, but I do remember that one duck was in front of two ducks, another duck behind two ducks. How many ducks did I see?
What is a ternary operator in c?
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL
Can the “if” function be used in comparing strings?
why arithmetic operation can’t be performed on a void pointer?