You are here:

C/Number Reversing !

Advertisement


Question
If a five digit number is input through the keyboard, write a program to reverse the number.

Answer
Hai dear sushmita !

  Here is the code , what you are actually looking for

#include<stdio.h>
void main()
{
  int n , i ;
  printf(" Enter a number:");
  scanf("%d" , &n);

  while( n )
  {
     i = n % 10;
     n = n / 10;
     printf("%d", i);
  }
}

I kindly request you to review this solution and  Get back to me in case of issues !

Thanks and Regards !
Prince M. Premnath

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Prince M. Premnath

Expertise


I'm sure that I can solve any doubts in Turbo C ,Graphics Programing ,Mouse, Hardware Programming ,File System ,Interrupts, BIOS handling , TSR Programming , General Concepts in C Language, handling inline Assembly statements

Experience

Research over 6+ Years

Organizations
CG-VAK Softwares and Exports Limited

Education/Credentials
Masters in Computer Applications

©2012 About.com, a part of The New York Times Company. All rights reserved.