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 noise figure?
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.
hi,i just want to know the best institute to learn oracle in bangalore because i am doing my BE there?
How will I MOve Comp-1 variable into next variable without using Move statement?
what is the need for oobs
what is active dirctory?
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
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?
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.
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
Whet is KCFT and difference between CFM and KCFT
How would you Update the rows which are divisible by 10, given a set of numbers in column?