Reverse a Number using C

Reverse a Number using C Programming Language


#include <stdio.h> 
int main() { 
int n, reverseNumber = 0, remainder; printf("Enter a number: "); 
scanf("%d", &n); while(n != 0) { 
remainder = n%10; 
reverseNumber = 
reverseNumber*10 + remainder; n /= 10; } printf("Reversed Number = %d", reverseNumber); 
return 0; }

Click here to run this code

Share with Friends

Twitter Facebook Google LinkedIn Email Pinterest Reddit StumbleUpon Tumblr

More Free Code Examples

Fibonacci Sequence Using C

C++ Odd or Even

C++ Code to Reverse a Number

Try these Fun Games by Bobbie:

Travel Blast Game New York

Play and Learn Russian

Battlestarship Game

Take a look at these Groovy Codes:

Fun IQ Test

Html Svg Starburst

Javascript Particles Fishes

Read the Latest Breaking Programming and Tech News, Great Articles and Tips:

Codenewz Programming and Tech News


Popular posts from this blog

Multi-tap Keypad Text Entry

HTML5 Crossword 1