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
What do you mean by client /server for a post scarcity world
what is the difference between error,exception,bug,defect,fault..?
I am 2012 pass out b tech student(cse). i have recently started software manual testing class. Is this field is benefitial for me in future?
i have passed my gRaduation in BCA and now im looking for post graduation from Germany, i haver passed my ielts wth 6 band, nw plz tell me some question that wll ambessay ask
reduce the number of key strokes to execute this command : t char -t -v -f/dev/fd0
Hi I am Krushna.I have already applied for PO post in Syndicate Bank.Can anybody send me the sample paper for Syndicate bank PO.
How small can you make a computer? What are the limiting factors?
differences between pass by reference and pass by value in c language?
I want the syllabus of Section Enginner(Signal & Telecom) of RRB Exam
How can I get know that my pc contains dram or sram..?
what is disadvantages of waterfall model ?? industry used which model ??
describe about storage allocation and scope of global,exterm,static,local and register variables in c language?
Box 1 cotain odd value X or Y the box 2 =X i.e 7 or 12 box 3= Y has value 19 if X is 7 or 31 if x is 12 get even value X or Y Use any operator steps allowed 3.
IS THE SAMPLE POINT OF LPG SPHERE TANK PEFOR OR AFTER BUMP?
what are the no. of leaf nodes in a fibonacci tree ?