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 are the preprocessor categories?
Where are local variables stored in c?
Is c is a middle level language?
How can I read in an object file and jump to locations in it?
What is break in c?
I have written a pro*C program to fetch data from the cursor. where in i have used the concept of BULK FETCH.... each FETCH statement is taking lots of time to fetch specified number of rows at...
Are pointers integers in c?
Explain the bubble sort algorithm.
What is meant by high-order and low-order bytes?
Is javascript written in c?
Who invented bcpl language?
c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above
Why are algorithms important in c program?
What is the function of volatile in c language?
largest Of three Number using without if condition?