answersLogoWhite

0

Inversing of a given Number. suppose we gave input 123456 then the output of the program will be 654321./*mycfiles.wordpress.com

C program to print inverse of a given number*/

#include

#include

void main()

{

long int n,rn=0,d=0;

clrscr();

printf("Enter the number\n\n");

scanf("%ld",&n);

while(n>0)

{

d=n%10;

rn=rn*10+d;

n=n/10;

}

printf("%ld",rn);

getch();

}

User Avatar

Wiki User

14y ago

Still curious? Ask our experts.

Chat with our AI personalities

JudyJudy
Simplicity is my specialty.
Chat with Judy
CoachCoach
Success isn't just about winning—it's about vision, patience, and playing the long game.
Chat with Coach
FranFran
I've made my fair share of mistakes, and if I can help you avoid a few, I'd sure like to try.
Chat with Fran

Add your answer:

Earn +20 pts
Q: C program to print inverse of a given number?
Write your answer...
Submit
Still have questions?
magnify glass
imp