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 far pointer?

1471


hi i am avinash ,i am doing ma b-tech(cse) final year and i have been detained for 2years due to attendance and i will be finished ma b-tech in 6 years ,plz tell me weather i will be eligible for government jobs like bhel, drdo,or any other private companies

1348


please send me latest Aptitude Test paper

1599


how to delete four out of five duplicate records in a table using sql

1455


If you had a cylinder, sealed at both ends, with the pressure rising inside, would it blow at the end or split along the side first?

1747






What is candidate key ? What is Alter net key ? & What is foreign key ?

1450


WHERE CAN I GET SQL SERVER NOTES SOFT COPY?

1341


How does C pass variables to a function ?

1586


Client server applications

1170


please answer the following question: A table contains the monthly sales data for the 12 months of a year and for the 4 sales zones where each zone has 8 districts.The table is defined in WORKING-STORAGE SECTION.What is the size of the defined table in number of bytes? write statements to calculate the total sales for each month.

1510


i need to alone print a number no text by using if statement .say some idea

1413


15. What is your Future Plans for the Company if Permanently Employed?

3377


Explain the difference between RAM and ROM? What is “Volatile Memory

875


one fuse has following data 80A 415V -6.9W HN SIZE 00 100 KA gG Please tell me about what is the mean of 100kA gG

1869


what are differences b/w EIA 449 and EIA 530?

1708