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
explain about scope and storage class in oops
What is the dewpoint of atmoshperic Air?
What is the use of generics? when was it added to jdk?
What is candidate key ? What is Alter net key ? & What is foreign key ?
sir ,,kindly provide me 10 year old solved question papers of gate ,i am from CS. branch...
write a c++ program to interchange two-integer number without using the third variable. use concept of constructor overloading.
operation of carrier aided protection and what is the basis for choice of frequncy in powerline carrier system
what is different between static block and public static void main??
5. Tell me about a time you were able to successfully deal with another person even when that individual may not have personally liked you (or vice versa).
why view is created in database
Problem:Design and implement a class that allows a teacher to track the grades in a single ourse.Include methods that calculate the average grae, the highest grade, and the lowest grade.Wrute a program to testyour class implementation in a c#. given grades:integral=85, physics=87, datastruct=84.
Discuss the various process operations, clearly stating what is involved in each process operation.
how to increase the water ring vacuum pump efficiency?
in HVAC how does the chiller functioned .. and what is the chiller cyclic process
How is the parity flag actually set in the 8085 microprocessor?