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 |
What is a decade?
how is the config take place and from reciever side how will process the data into internal table
how many protocols are available and what are they?
In HSE what is Lost time accident? why it is to be reported within 48 hrs to gov.authorities ?
what is the difference between BE and BTECH??
write an algorithm in O(n) time for finding the kth smaalest element form an array of n elements , where n and k are entered by user
Please state briefly the reasons why you think you are an outstanding candidate for this job
write a program to print only the largest number between elements of an 1-d array?
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
Explain how a TP Monitor manages memory and processor resources more effectively than a typical operating system.
what is the basic need for tech..test?
display the second highest salary department wise in employee table
Civil Engineering (5086)
Mechanical Engineering (4456)
Electrical Engineering (16639)
Electronics Communications (3918)
Chemical Engineering (1095)
Aeronautical Engineering (239)
Bio Engineering (96)
Metallurgy (361)
Industrial Engineering (259)
Instrumentation (3014)
Automobile Engineering (332)
Mechatronics Engineering (97)
Marine Engineering (124)
Power Plant Engineering (172)
Textile Engineering (575)
Production Engineering (25)
Satellite Systems Engineering (106)
Engineering AllOther (1379)