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

What is noise figure?

1 Answers  


hi........ i am a student of computer science. i want to earn some money on net so that i can help my parents. so please suggest me some sites which give online part time jobs without any registration charges. please help me. i will be very thankful to you. varinder.

1 Answers  


hi,i just want to know the best institute to learn oracle in bangalore because i am doing my BE there?

0 Answers  


How will I MOve Comp-1 variable into next variable without using Move statement?

0 Answers  


what is the need for oobs

0 Answers  






what is active dirctory?

2 Answers   jetking,


hi, i m ganesh.. i have cleared LAKSHMI VILAS BANK FOR clerical post... any body who have already received interview call letter pl mail me to my mail id ganesh_280574@rediffmail.com my mobile no is 9842648112

6 Answers   Lakshmi Vilas Bank,


Method to solve question to find the number of zeros in a sequence given by: 1^1*2^2*3^3*4^4*5^5*6^6*........*99^99*100^100?

1 Answers  


Write a function that responds to a click anywhere on the page by displaying an alert dialog. Display the event name if the user held Shift during the mouse click. Display the element name that triggered the event if the user held Ctrl during the mouse click.

0 Answers   HCL,


I am looking for NIC Scientific Officer / Engineer-SB (Programmer)Sample papers or any portion of questions/ syllabus plz, send me on sengupta.pranab@gmail.com. Regards PRANAB

0 Answers  


Whet is KCFT and difference between CFM and KCFT

0 Answers  


How would you Update the rows which are divisible by 10, given a set of numbers in column?

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)