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
‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.
Define circular linked list.
What is the use of a ‘ ’ character?
How can I find out how much free space is available on disk?
the 'sizeof' operator reported a larger size than the calculated size for a structure type. What could be the reason?
Can we declare a function inside a function in c?
Is there a way to jump out of a function or functions?
Can you please explain the difference between syntax vs logical error?
Can we initialize extern variable in c?
Difference between goto, long jmp() and setjmp()?
Differentiate between the expression “++a” and “a++”?
Dont ansi function prototypes render lint obsolete?
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
Can a void pointer point to a function?
What is the purpose of clrscr () printf () and getch ()?