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 |
how to find sum of digits in C?
main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }
Tell me with an example the self-referential structure?
please give me some tips for the selection in TCS.
Is register a keyword in c?
Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college. 1.write a function to print names of all students who joined in a particular year 2.write a function to print the data of a student whose roll number is given
Why is c called "mother" language?
Why isn't any of this standardized in c? Any real program has to do some of these things.
void main() { int a=1; printf("%d %d %d",a,++a,a++); } the output is supposed to be 1 2 2....but it is 3 3 1 this is due to calling conventions of C. if anyone can explain me how it happens?
int i=10; printf("%d %d %d", i, i=20, i);
Write a c program to demonstrate Type casting in c?
Is it possible to have a function as a parameter in another function?