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 is candidate key ? What is Alter net key ? & What is foreign key ?
how to store the vacuum in tank? its possible? what are the units for measure the vacuum ?
pls its urgent!!!!!!! can u tell me which companies are hiring fresher for industrail training???i know only two companies cmc which is in bandra n biz tech solution in kandivali. can anyone knows other companies??how much fees r they taking?? what about biz technology?this company is good to join if anyone has did d industrial training in biz technology then pls reply as urgent as possible. thank you ....waiting for replyyyyy
what are differences b/w EIA 449 and EIA 530?
What are daemon Threads?
How to work Air cooled and water cooled chiller?
Explain about a light bulb
how you judge that your interview go good????
how configur net and vpn on cisco product
searching a B-tree indexed tree compared to B+ tree is slow..True or false
how to use photoshop and some related websites?
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
what are the Types of End User in dbms?
WAP in Java to print the format A B A B C D E D E
BEL old probationary engineering questions and answers