AllExperts > Experts 
Search      

C

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More C Answers
Question Library

Ask a question about C
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About 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
  • Experience in this area :
  • Research over 4+ years.
  • Education/Credentials :
  • Masters in Computer Applications
  • Organization belongs to :
  • ST Joseph College (SFS) Trichy

 
   

You are here:  Experts > Computing/Technology > C/C++ > C > Number Reversing !

Topic: C



Expert: Prince M. Premnath
Date: 5/14/2008
Subject: Number Reversing !

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

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.