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


Please Help Members By Posting Answers For Below Questions

What is the mistake in the following program segment ? f() { int a; void c; f2(&c,&a);}

3406


Hi l, I want to install a water purifier (UV) at my home. the distance of water purifier from water tank [1000 lt ] is 7 ft. Is it sufficient for electrical water purifier? I want to know what is the water pressure from 1000 lt tank (the pipe used from water tank to machine is of inch 1-1/4") please note minimum water pressure is required for UV is - Water Pressure Min: 0.4 kg/sq. cm.Max: 2.0 kg/sq. cm. Please advise me on the following: 1) What is the water pressure generate in above condition. 2) What is the required height from the UV machine to water tank for the above condition? Thanks is advance.

1484


different types of protocols.......?

1434


hi friends.... i want do telecom course, iam getting confused. plz tell me courses and levels in that field. iam fresher B.E ECE student. and plz tell institutes in hydrabad or bangalure.

1658


why we use conio.h in c programming?

1668






what is defect tracking in sotware testing

1385


when did actually oil exploration start

1442


please send me latest Aptitude Test paper

1588


how to write regression test case?what is the difference between Client server & web based Testing? can we able to do UI Testing in web based Testing

1406


difference between arrays and linked list in c language?

1557


What are the inspection and test plan for lift materials?

1544


I APPLIED SBIPO EXAM PLZ SEND ME THE INTERVIEW QUESTIONS AND GD TOPICS AND WRITTENEXAM QUESTIONS

1635


Please send the details and fee for Intools training course..I would like to do the course in second week of jUNE 2010.

1752


Write a program to count the no. of occurrence of word in given string Ex- Ram is good boy. Ram is doing good job. Ram – 2 is – 2 good – 2 boy – 1 doing –1 job – 1

3254


how strcpy usingrecursive function

1568