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
i want a program in c# for 100 or for a number greater than 100.....pls help
successful command to make linux system as router in redhat-+
what is the Relationship between quantity of Gas and capacity of AC machine in tonnage.
Qatar petroleum will call me for an technical phone interview as safety officer Please let me know what kind of question they asked ? any idea about this written test ?
Write the fetch cycle and execute cycle for following instructions:JMPNZ (jump to the given address if the accumulator not equal to zero) RET(return from a subroutine) ADB (add the contents of register B to the accumulator and save result in the accumulator).
Relative Humidity (RH) is mostly used word in Datacenters, What are the defendents of RH
can u tell me any JAM topics.........and answers also...plz send me.........e-mail: anitha839@gmail.com
a steel bar 1' inch square 6' long is to be used as a column.ends are free to rotate put may not be displaced.stress is limited to 30,000 PSI
Hello friend I am Manish from delhi I clear the written exam of NIC(national insurance company),If any one have any idea about inerview plz send me details my no:-9999026117,Email id:-bittu523@yahoo.com
what is the differences between software engineering and other engineering disciplines.
how to use two diffirent gatway in one system
how to convert postfix notation into prefix in data structures. please send me algo of taha
differance between radix sort and radix exchange sort
CSS corp interview process and placement papers
as we know that java is a platform independent language, but we need jvm for the same operating system why?