answersLogoWhite

0


Best Answer

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
This answer is:
User Avatar

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
Related questions

How do you write a program to print Inverse number in PHP?

There are two types of inverse numbers in this context: additive and multiplicative. An additive inverse number is a number that's had its sign flipped: positive becomes negative, and negative becomes positive. The PHP code for this would be: $result=-$number; A multiplicative inverse number is a number that's been divided into 1. So 5 becomes 1/5, and 1/5 becomes 1/1/5, or 5. The PHP code for this would be: $result=1/$number;


C program to fine the largest of 10 given number?

first sort the ten numbers in descending order and print the first number. That will be the largest no


How to write A Java program to print number of digits in a given number?

One way to do this is to convert the number to a String, then use the corresponding String method to find out the length of the String.


How do you prepare a program in basic to display the word and the number of letters in it when is given as input?

10 cls 20 input"enter word";word$ 30 print word$ 40 print len(word$) 50 end this program is for GW BASIC for other BASIC's the line numbers are optional.


C plus plus program to print number patterns?

bghjg


You are write a program that will read a list of number in the range from 1to n and will print for each number the corresponding term in cantor's enumeration as given no blank line should appear last?

see pages 43-49 in Principles of Program design by M. A. Jackson, 1975


Program for print prime all number from 1 to 100 in foxpro?

Prime numbers are numbers that are only divisible by themselves and the number 1. You can write a program to print all prime numbers from 1 to 100 in FoxPro.


How do you solve this program wap to print sum of a digit of an inputed number?

wap to print all the arnstrong no. between 100&1000


Write a java script program to print first ten odd natural numbers in C?

Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.


A C program to print the number of words from given String?

/*We can calculate this with a lot of methods I'll explain only one of them */ *str = "abcd"; // this is a input string printf("%d", strlen(str));


To print the multiples of a given number using loops in c?

Yes, it is possible to do that.


Program to print the greatest number in unix?

There is no such thing as 'the greatest number'. Here is a program in unix to prove it: echo 'for (i=1; i>=0; i= i*2) print i,"\n";' | bc if you want to actually see the output use it this way: echo 'for (i=1; i>=0; i= i*2) print i,"\n";' | bc | less -S