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
what is far pointer?
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
please send me latest Aptitude Test paper
how to delete four out of five duplicate records in a table using sql
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?
What is candidate key ? What is Alter net key ? & What is foreign key ?
WHERE CAN I GET SQL SERVER NOTES SOFT COPY?
How does C pass variables to a function ?
Client server applications
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.
i need to alone print a number no text by using if statement .say some idea
15. What is your Future Plans for the Company if Permanently Employed?
Explain the difference between RAM and ROM? What is “Volatile Memory
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
what are differences b/w EIA 449 and EIA 530?