Program print the input number , in right to left order (means reverse traversing)
note: user can only put four digit number , if you want to insert more number leave message ....
Source Code:-
#include<iostream.h>
#include<conio.h>
void main()
{ clrscr();
int n,a,b,c,d;
cout<<"Reverse Traversal by Tarun Rawat\n";
cout<<"Enter four digit number \n";
cin>>n;
if(n!=0)
{ a=n%10;
b=n/10%10;
c=n/100%10;
d=n/1000%10;
cout<<a<<b<<c<<d;
}
getch();
}
Welcome to " way2cplusplus.blogspot.in " Objective of this blog is to implement various Computer Science Engineering Lab problems into C++ programming language. These are basically most common Lab Exercise problems based on the curriculum of engineering colleges throughout the Nation. These lab exercises are also relevant to Data structure. Simply C++ programming zone...
No comments:
Post a Comment