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
Q1. A. Discuss the various types of variables. B. How to control the file? Q2. A. How the image application? B. Write short notes on trees structures work. Q3. A. How to load and unload child forms. B. When should we use recursive programming Q4. A. Write short notes on “The ole control’s shortcut menu” B. How to test the AX stat class Q5. A. How to use advanced data-bound controls. B. Write notes on manipulating the recordset object Q6. A. What is script control? B. How to down load image properties. C. What is meant by building a recordset.
WHAT IS THE PROPER LOCATION OF SAMPLE POINT OF LPG SPHERE TANK?
which is better php,asp.net,jsp? and why?
compair and contrast procedrual and object oriented programming language
What is the pattern for HAL Online-exam?
Explain different parts of an instruction. What does the addressing mode bit specifies?
What do you mean by client /server for a post scarcity world
I have attended offcampus conducted by polaris chennai.And i have cleared all rounds on 10th June 2014.They collected all my marksheet xerox and address proof and said that they will send me offer letter in 3 days.. But more than 15days passed but still i didnt receive any information. I am lot depend on this offer... so when can i expect offer letter?? will they surely send me offer letter?
how strcpy usingrecursive function
what is the difference between physical address and logical address?
What is the difference between tcp/ip protocol and IP protocol?
If i update, insert or delete records in my view will it affect my base table?????
convert 140 N.m/cm^2 to N.m/mm^2
what are all the browsers..?
Hello sir i finished my BE computer 2009 batch. I'm not gud at programming like 0 knowledge and i'm not interested in it too . Except this programming field is anyother option to afford into a new one ??????? can anyone help me plz