This program reverse the number entered by the user and then prints the reversed number on the screen. For example if user enter 123 as input then 321 is printed as output. In the program we use modulus(%) operator to obtain the digits of a number. To invert number look at it and write it from opposite direction or the output of code is a number obtained by writing original number from right to left. To reverse or invert large numbers use long data type or long long data type if your compiler supports it, if you still have large numbers then use strings or other data structure.
Wednesday, 20 August 2014
C program to reverse a number

Artikel Terkait
- C program to check leap year: c code to check leap year, year will be entered by the user
- These programs illustrate various programming elements, concepts such as using operators,
- Fibonacci series in c programming: c program for Fibonacci series without and with r
- This c program add n numbers which will be entered by the user. Firstly user will enter a
- A palindrome number is a number such that if we reverse it, it will not change. For examp
- C program to perform basic arithmetic operations which are addition, subtraction, multipl
Subscribe to:
Post Comments (Atom)
EmoticonEmoticon