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 should i say in the interview if interviewer asks me "why did you choose IT instead of your core group?"
hello sir, i'm persuing my B.tech final year in textile chemistry and have a diploma in electronics and communication...interviewer ask why you should adopt textile chemistry from electronics and communication....please give me the best answer... thank you
Draw the diagram showing the function stack, illustrating the variables that were pushed on the stack at the point when function f2 has been introduced . type def struct { double x,double y} point; } main( int argc, char *arg[3]) { double a; int b,c; f1(a,b); } f1(double x, int y) {point p; stack int n; f2(p,x,y) } f2(point p, double angle) { int i,j,k,int max;
I am some what lagging in talking English but i love to do job as an software engineer what will i do to improve my communication skills? please give me answer..........
briefly explain about your project? please tell me about this answer . my current project is ERP domain web based application.please please help me
what is overflow and what are the conditions for which overflow possible?
find the net id and host id of the following IPV4 117.34.3.8 and 132.57.8.6
what is the difference between physical address and logical address?
what does the interviewer mean by saying "have a good life " cheerfully at the end of an HR interview??? is this positive to be selected reply yes or no
I have failed my intermediate can i write entrance exam the next year after completing my backlogs
what is different between static block and public static void main??
nohup sort employees > list 2 > error out & what will happen?
what is total power generation capacity in india at present (as on 12-12-2011)
Discuss the various process operations, clearly stating what is involved in each process operation.
what is dns?