Program to exchange the digits of 2-digit number



     # include <iostream.h>
     int main( )
     {
    int number, temp, tens;
    cout<<"Enter 2 Digit-Number : " ;
    cin>>number;
    cout<<"\n The Original Number : "<<number;

    temp = number % 10;
    tens = 10 * temp;
    temp = number /10;
    number = tens + temp ;

    cout<<"\n The Exchanged Number : "<<number;
    return 0;
      }

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|