HOW TO FIND OUT THE RREVERS OF A GIVEN DIGIT NUMBER IF IT
IS INPUT THROUGH THE KEYBORD BY USING C LANGUAGE
Answer Posted / prof.gagandeep jagdev
#include<stdio.h>
#include<conio.h>
long int num,result=0,i;
void main()
{
clrscr();
printf("\nenter the number to be reversed=");
scanf("%ld",&num);
while(num>0)
{
i=num%10;
num=num/10;
result=result*10+i;
}
printf("\nReversed number is=%ld",result);
getch();
}
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
What is structure packing in c?
Explain the difference between null pointer and void pointer.
How do you view the path?
The file stdio.h, what does it contain?
Why we write conio h in c?
What is scope rule of function in c?
why we wont use '&' sing in aceesing the string using scanf
pierrot's divisor program using c or c++ code
How are Structure passing and returning implemented by the complier?
any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()
What is C language ?
What is the difference between āgā and āgā in C?
What is bss in c?
Write a factorial program using C.
what is the significance of static storage class specifier?