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



write a program to accept 2 numbers from user calculate sum of each digit,reverse the orignal numb..

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

write a program to accept 2 numbers from user calculate sum of each digit,reverse the orignal numb..

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

Post New Answer

More Engineering AllOther Interview Questions

how to find out the name of the users who are currently working starting with the same characters in unix os

0 Answers  


Hi, what is the meaning of DOCUMENTUM,how and what testers have to do with it?

0 Answers  


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

0 Answers  


wats the difference between RS latch using NAND n NOR gate? which is to be preffered?

0 Answers   ABC,


how to use two diffirent gatway in one system

0 Answers  






What is the full forms SDDC,TOR,DLRO,PPP,USW,AWWA,CMOS,SVI,

1 Answers  


what is fabrication process?

1 Answers   L&T,


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.

0 Answers  


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?

0 Answers   CEERI,


PLZ SOMEONE TELL ME WHICH TYPE OF QUESTIONS IS ASKED IN HLL(Hindustan latex ltd.)mangmt trainee entrance exam?

0 Answers  


what we have to say about hobbies,strong points,weak points

0 Answers   Banking,


hai...i need the interview questions of php...its very urgent

0 Answers  


Categories
  • Civil Engineering Interview Questions Civil Engineering (5085)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4451)
  • Electrical Engineering Interview Questions Electrical Engineering (16632)
  • Electronics Communications Interview Questions Electronics Communications (3918)
  • Chemical Engineering Interview Questions Chemical Engineering (1095)
  • Aeronautical Engineering Interview Questions Aeronautical Engineering (239)
  • Bio Engineering Interview Questions Bio Engineering (96)
  • Metallurgy Interview Questions Metallurgy (361)
  • Industrial Engineering Interview Questions Industrial Engineering (259)
  • Instrumentation Interview Questions Instrumentation (3014)
  • Automobile Engineering Interview Questions Automobile Engineering (332)
  • Mechatronics Engineering Interview Questions Mechatronics Engineering (97)
  • Marine Engineering Interview Questions Marine Engineering (124)
  • Power Plant Engineering Interview Questions Power Plant Engineering (172)
  • Textile Engineering Interview Questions Textile Engineering (575)
  • Production Engineering Interview Questions Production Engineering (25)
  • Satellite Systems Engineering Interview Questions Satellite Systems Engineering (106)
  • Engineering AllOther Interview Questions Engineering AllOther (1379)