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
how to handle errors in fastload?
how the parting surface is selected in injection mould
What is "strstream" ?
What is histogram? why and how it is used?
please send me latest Aptitude Test paper
discus the worst and best case complexity of binary search
If any kind of accident happen without any information to any one .what kind of action we have to take
differences between pass by reference and pass by value in c language?
How can I get know that my pc contains dram or sram..?
hello sir,pls fdorward previous group-I exam papers .....
What is Lease Line?Why power cord is not required to NT Boxex on which lease is connected ?Why we use use NT BOXEs for ISDN and Lease line?
I an doing Engineering in IT(4th year). i want to know what is the scope or .NET and Linux, and which is better for carrier
HOW WE CAN CORRELATE THE MA\ECHANICAL POWER TO ELECTRICAL POWER. SUPPOSE IF I WANT A PUMP OF PUMPIG 200 LPM AT 20 METER HEAD MENAS WHAT IS THE POWER NEEDED FOR PUMP IN ELECTRCAL AND HOW CAN WE GET IT
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
PLZ SOMEONE TELL ME WHICH TYPE OF QUESTIONS IS ASKED IN HLL(Hindustan latex ltd.)mangmt trainee entrance exam?