write a program to accept 2 numbers from user calculate sum
of each digit,reverse the orignal number and display
Answer Posted / amol
Void main()
{
Int x,y
Cout<<”enter two nos”
Cin>>x>>y;
Cout<<”Menu”<<endl;
Cout<<” 1. Addition 2. Subtraction 3. Multiplication 4.
Swapping the values 5. Reverse order”;
Cin>>c;
Switch(c)
{
Case 1: sum=x+y
Cout<<sum;
Case 2: sub=x-y;
Cout<<sub;
Case 3: pro=x*y;
Cout<<pro;
Case 4:swap=x;
x=y;
y=swap;
cout<<x<<y;
case 5: while(x/10!=0)
{
n++;
}
For(i=1;i<=n;i++)
{
Cout<<”reversed x=”;
r=x%10;
Cout<<r
x=x/10;
}
while(y/10!=0)
{
n++;
}
For(i=1;i<=n;i++)
{
Cout<<”reversed y=”;
r=y%10;
Cout<<r
y=y/10;
}
Default: break;
}
Getch();
}
| Is This Answer Correct ? | 8 Yes | 10 No |
Post New Answer View All Answers
where is the first engeenering college of Asia
hi all I got two exam call letter one from maha ganeco & other from federal bank both at same time & same date which should i choose (note I am eng. grad.)
what is the different between view and materialized view in oracle DBA?
explain bug tracking system in detail.
I am some what lagging in talking English but i love to do job as an software engineer what will i do to improve my communication skills? please give me answer..........
send me e-mail on dell tech question papers 2011 -2012
why view is created in database
what is locative information on web.........?
if u have question papers/sample papers of any of PSUs,plz send me at dinesh.pandey3@gmail.com
what is different between static block and public static void main??
I am going to HAL Online test for Computer Science. Can you please mail me the model question papers ?
can any one give 10 ways to create a file in unix...???? through command prompt....
What is CRC? the material will be used in electrical stampings.
how to use photoshop and some related websites?
pls its urgent!!!!!!! can u tell me which companies are hiring fresher for industrail training???i know only two companies cmc which is in bandra n biz tech solution in kandivali. can anyone knows other companies??how much fees r they taking?? what about biz technology?this company is good to join if anyone has did d industrial training in biz technology then pls reply as urgent as possible. thank you ....waiting for replyyyyy