answersLogoWhite

0

How do you Write a C program to reverse an Integer number.?

Updated: 8/21/2019
User Avatar

MahmudaKeyagp3972

Lvl 1
9y ago

Best Answer

Reference:cprogramming-bd.com/c_page2.aspx# reverse number

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you Write a C program to reverse an Integer number.?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How to write a program in python to print the reverse of a number?

In python, type the following into a document. NOTE: Sentences following a # symbol are comments, and are not necessary for the program to run. #!/usr/bin/python #This program takes a input from a user and reverses it. number = input("Type a number: ") #This takes input from a user. a = len(number) #This finds the length of the number reverse = "" #This sets the variable reverse to an empty string. for i in number: a = a-1 #The places in a string start from 0. The last value will be the length minus 1.reverse = reverse + number[a] #Makes the number's last digit the new string's first. print("The reverse of", number, "is", reverse + ".") #prints the resulting string. This program will take any sequence of characters and reverse them. The final value is a string, but if an integer is needed, one needs only to add the line reverse = int(reverse) above the print statement. However, this will stop the program from being able to reverse strings, as it is not possible to convert a string to an integer if it is not a number.


Write a program to subtract integer y from integer x?

x -=y;


How can I write a program to display prime numbers from 1 to 100?

Write a function that implements an algorithm that checks to see if a particular integer is prime (returning a boolean). Write a program that uses that function on each number from 1 to 100, and if true, displays that number.


How do you write 5789 as an integer?

The number 5789 is already an integer.


Write a program that converts a decimal number to nearest integer?

prompt x floor(x + .5) -> x disp x


How do you write a program that outputs a given characters in reverse?

write the javascript code to display the reverse no. of given no. (e.g. 247 reverse of 742)


Is -3 a real number and an integer?

Yes. An integer has no fractions and if you can write it, it's a real number!


How do you write c program to test that an integer number is divisible by 2?

int isDivisibleByTwo(int N) return N % 2 == 0;


How do you write 2 million as an integer?

2,000,000 an integer is any whole number


How do you write 187 as an integer?

187 is already an integer because it is a whole number


How do you write 500 percent as an integer?

500% as an integer or whole number is 5


How you write a program in c plus plus to print plaindromic numbers from 1 to n?

To check if a number is a palindrome, reverse the number and see if it is equal to the original number. If so, the number is a palindrome, otherwise it is not. To reverse a number, use the following function: int reverse(int num, int base=10) { int reverse=0; while( num ) { reverse*=base; reverse+=num%base; num/=base; } return(reverse); }