Pages

Sunday, October 6, 2013

The Reverse Digit in c++

This is the 1st activity we did in our school. The Reverse Digit digit, you will input 3 integer and the output comes in reverse.

# include <iostream>
using namespace std;
int main ()
{
int x=0, y=0, z=0, a=0;
cout<<"Enter First Digit:"; cin>>x;
cout<<"Enter Second Digit:"; cin>>y;
cout<<"Enter Last Digit:"; cin>>z;
cout<<"The Reverse Value:" <<z<<y<<x;
cout<<endl;
system ("pause");
}

This is the output:
Enter First Digit:5
Enter Second Digit:4
Enter Last Digit:3
The Reverse Value: 345


No comments:

Post a Comment