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

my first question in huawei was ....1)Tell me about your self 2) oops concept 3)logic gates 4)ram and rom ,what is cache memory nd where it is located 5)diffrence between file system and data base 6) procedure of operating system 7)what is c# 8)high level language and machine language 9) and from mobile networkin !!!! hope thz will help you

0 Answers   Huawei,


Sketch a velocity time graph for a skydiver jumping out of a plane.

0 Answers  


wat is the process of civil services examination...I want to become DSP....Is civil services and APPSC are sam???first of all for wat we have to prepare...for prelimnary or for mains or for nterview...i dont know any thing...please help me...arun.kanduri@gmail.com

1 Answers  


hi friends, i got selected in tcs, i m doing my b.e in one of the college in coimbatore.. i don have questions to post u.. but i have valid suggestion..its waste to prepare apti for tcs by looking at last 10 year question from internet.they changed all the apti question this year(2009).. but apti questions is easy..prepare critical reasoning for gre 12th edition..mug up the answers in critical reasoning.. u can download ebook for gre 12th edition..solve the critical reasoing question at the same time mug up it.. there were totally 3 critical reasoning question asked.. two for gre 12th edition so if u mug up u can finish two questions in 3 min.. so u will have 27 min for other question so u can work it out and find the ans..above i mentioned as 3 questions tat is 3 question means ,three paargraph.. each para carries 4 question so totally 12 question in critical reasoning.. if u clear all 12 question u will be selected.80% percent sure.then don mug up synonyms from gre barron because they are asking same question from barron but the choice for the questions are changed.. so study synonyms and antonyms from internet.. some pupils have posted the questions.. in tech and h r don use complex word or don show tat u r so dminant.. talk with them how u will speak wit ur friend. u will be through.. don think wat i have posted above is lik some info in other site.. wat i said is true.. they changed apti tis time.. u will be selected if u follow wat i said..again i m saying pls concentrate on critical reasoning.. if all questions in it are right u r through..bye

0 Answers  


What is HPLC ? and define it.

0 Answers  






What is OSPF Open shortest Path First attributes?

0 Answers  


How is the parity flag actually set in the 8085 microprocessor?

0 Answers  


A code which had some declarations of some data items. There were a couple of normal data items(char,int..) and some pointers as well and a malloc call. You have to find the total memory taken up in the stack(Hint:Pointers and all are allocated in heap, not in stack, so dont count them).Also in most of these questions, they were specifying that the OS was 32 bit

0 Answers   Syntel,


ABOUT US We, the Meritas Team, is a group of committed and hardworking professional techies, trainers and business consultants. We create, improvise and adapt the best practices in training industry to help our students to standout in the job market to get placed fast. Once a student joins with us, we impart the best possible technical real-time training. Along with that we give utmost care to groom his/her communication, leadership, interpersonal and language skills. We have a committed team of professional HR professionals to help our students to find their dream jobs as soon as they finish their courses.

1 Answers   Meritas,


1. Design a counter which counts 0, 4, 8, 2, 6, and repeats using: 1.a using JK flip flops 1.b using T flip flops 1.c using D flip flops 2. Modify your design in question 1.a so that the circuit works according to the following function table X Y F 0 0 Clear 0 1 No Change 1 0 Parallel Loading 1 1 Count 3. Design a circuit that detects the pattern 010 in a serial input X considering: 3.a Overlapping 3.b No overlapping

0 Answers  


What would be your first invention?

0 Answers  


can u tell me any JAM topics.........and answers also...plz send me.........e-mail: anitha839@gmail.com

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)