to find out the reverse digit of a given number
Answer Posted / 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>9)//456
{
a=a/10;//a=45
b=b*10+a%10;//65
return rev(a,b);
}
else
return b;
}
| Is This Answer Correct ? | 3 Yes | 5 No |
Post New Answer View All Answers
What do you mean by scope of a variable in c?
which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above
What is the use of header?
Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?
please help me..... please codes and flowchart plz turbo c lang po yan.....please asap response... 3. Make an astrology program. The user types in his or her birthday (month, day, and year as integer), and the program responds with the user’s zodiac sign, horoscope, and other information related to it. If the user’s birth year falls into a leap year, your program should display an appropriate message for it. NOTES: Conditional Statements: it should be with graphics
Explain what is the benefit of using const for declaring constants?
What is meant by gets in c?
Why is c so popular?
When should a type cast be used?
Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?
Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.
Where define directive used?
What is difference between function overloading and operator overloading?
With the help of using classes, write a program to add two numbers.
pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)