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


Please Help Members By Posting Answers For Below Questions

‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.

1879


Define circular linked list.

571


What is the use of a ‘’ character?

586


How can I find out how much free space is available on disk?

629


the 'sizeof' operator reported a larger size than the calculated size for a structure type. What could be the reason?

564






Can we declare a function inside a function in c?

588


Is there a way to jump out of a function or functions?

636


Can you please explain the difference between syntax vs logical error?

697


Can we initialize extern variable in c?

632


Difference between goto, long jmp() and setjmp()?

708


Differentiate between the expression “++a” and “a++”?

705


Dont ansi function prototypes render lint obsolete?

603


a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above

873


Can a void pointer point to a function?

571


What is the purpose of clrscr () printf () and getch ()?

595