write a program to accept 2 numbers from user calculate sum
of each digit,reverse the orignal number and display
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / amol
Void main()
{
Int x,y
Cout<<”enter two nos”
Cin>>x>>y;
Cout<<”Menu”<<endl;
Cout<<” 1. Addition 2. Subtraction 3. Multiplication 4.
Swapping the values 5. Reverse order”;
Cin>>c;
Switch(c)
{
Case 1: sum=x+y
Cout<<sum;
Case 2: sub=x-y;
Cout<<sub;
Case 3: pro=x*y;
Cout<<pro;
Case 4:swap=x;
x=y;
y=swap;
cout<<x<<y;
case 5: while(x/10!=0)
{
n++;
}
For(i=1;i<=n;i++)
{
Cout<<”reversed x=”;
r=x%10;
Cout<<r
x=x/10;
}
while(y/10!=0)
{
n++;
}
For(i=1;i<=n;i++)
{
Cout<<”reversed y=”;
r=y%10;
Cout<<r
y=y/10;
}
Default: break;
}
Getch();
}
Is This Answer Correct ? | 8 Yes | 10 No |
how to find out the name of the users who are currently working starting with the same characters in unix os
Hi, what is the meaning of DOCUMENTUM,how and what testers have to do with it?
pls i need a help from you friends, is there anybody who can help me out with the question been ask from the USA embassy. i will be going for interview next month pls help me
wats the difference between RS latch using NAND n NOR gate? which is to be preffered?
how to use two diffirent gatway in one system
What is the full forms SDDC,TOR,DLRO,PPP,USW,AWWA,CMOS,SVI,
what is fabrication process?
Box 1 cotain odd value X or Y the box 2 =X i.e 7 or 12 box 3= Y has value 19 if X is 7 or 31 if x is 12 get even value X or Y Use any operator steps allowed 3.
How we can read an Image in VC++?How we can find out the intensities of the pixels of an image and dimension of the image?
PLZ SOMEONE TELL ME WHICH TYPE OF QUESTIONS IS ASKED IN HLL(Hindustan latex ltd.)mangmt trainee entrance exam?
what we have to say about hobbies,strong points,weak points
hai...i need the interview questions of php...its very urgent