write a program to accept 2 numbers from user calculate sum
of each digit,reverse the orignal number and display

Answer Posted / raja mansoor

#include<stdio.h>
#include<conio.h>
Void main ()
{
Int x, y;
Printf (”Enter two numbers”);
Scanf (“%d %d, &x, y);
1. Addition
2. Subtraction
3. Multiplication
4. Swapping the values
5. Reverse order”;
Getche () ==c;
Switch(c)
{
Case 1: sum=x+y
Printf (“%d”, sum);
Case 2: sub=x-y;
Printf (“%d”, sub);
Case 3: pro=x*y;
Printf (“%d”, pro);
Case 4: swap=x;
Printf (“%d”, x=y);
y=swap;
Printf (“%d %d”, x, y);
Case 5: while(x/10! =0)
{
N++;
}
For (i=1; i<=n; i++)
{
Printf (”Reversed of x is %d=”);
r=x%10;
Printf (“%d”, r);
x=x/10;
}
While(y/10! =0)
{
N++;
}
For (i=1; i<=n; i++)
{
Printf (”Reversed of y is %d=”);
r=y%10;
Printf (“%d”, r);


]
y=y/10;
}
Default: break;
}
Getch ();
}

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a function that responds to a click anywhere on the page by displaying an alert dialog. Display the event name if the user held Shift during the mouse click. Display the element name that triggered the event if the user held Ctrl during the mouse click.

1367


what is the formula/ ratio for hollow block? considering to a 40 kgs of portland cement.

1393


What is the Boundary value analysis and Equlance class partition for select * from emp

1781


Anyone have thesis paper about "Electrical Load Forecasting" . Or the web addresses where people usually upload their thesis paper except IEEE.

1390


what does complexity means in an algorithim?? how it is calcutaed?

1967






Suppose you want to form a conceptual model of UML.What elements would you require for this purpose?

1599


Write a nonrecursive routine to reverse a singly linked list in O(N) time.

3114


What is Symbian.?

1507


tell me one scenario where we go for idoc and WHy we go for idoc.

1820


1)what to do in emergency situation of having total blackout (on a ship) 2)what to do in emergency situation of flooding in the engine room 3)under what conditions would engine room bilges be pumped overboard? 4)why is high pressure required for the injection of fuel into the cylinder of diesel engine. 5)why is doubled walled pipes employed for high pressure fuel lines? 6)reasons for overheating of main engine 7)how to detect choked fuel valve,leaky piston rings and their remedies during operation in diesel engine? 8)effects of insufficient or excessive cylinder lubrication? 9)causes of a diesel engine piston overheating.

3247


Whet is KCFT and difference between CFM and KCFT

1424


i have an interview in Qatar Petroleum. So please provide the all details abt safety management

1577


What is meant by relay & co-ordination at substation engineering ?

1823


What is the key element of Defect Report and Test case format?

1191


i need NIC written test paper or give me any idea about written exam.Plz send me at smileever8@gmail.com

1692