write a program to accept 2 numbers from user calculate sum
of each digit,reverse the orignal number and display
Answer Posted / 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 View All Answers
What is meant by relay & co-ordination at substation engineering ?
what is the differences between software engineering and other engineering disciplines.
What is HPLC ? and define it.
Explain the concept of segmentaion.
I have failed my intermediate can i write entrance exam the next year after completing my backlogs
is it possible to get u.s visa with 55% in b-tech and 15 backlogs
find the salary of an employee where employee number is known
WHY WE SELECT U AS A PERTOLEUM ENGINEER THOUGH UR MARKS ARE LESS THEN OTHER APPLICANTS
10. Write a program in ‘C’ language that will perform the following operation on double link list. Each node of this list contains the address of previous as well as next node. The previous pointer of first node & next pointer of last node should contain null. 1. Creation of list with as many records as user want 2. Search a node in the list 3. Deletion at last position 4. Display 5. Exit Create separate functions for each operation. The create () will be used to create the list. It should accept no argument & return the address of the starting node. Search() will search a node in the list. It receives rollno as argument & return that node if found otherwise return null. The delete () function will delete the last node. It does not receive any argument & return structure type value at last position. The starting node of the double list must be declared as external pointer variable. Each element of double link list will contain the following information Roll No, Std Name, Course. Use do-while loop & switch case for generating the above menu. The format of the output should is given below: S.No. Roll No. Student Name Course 1 cse01 Anil Singh B.Tech
how can i install windows-xp operating system in single time to 50 computersconnected in a LAN.
can anyone help me with an article or a few pointers on what are the industry expectations from Fresh engineers in today's market scenario
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?
sample sbi questions paper
What are the duties of QA/QC Coordinator
How to write test cases for Auditing in Health care Applications?