write a program to accept 2 numbers from user calculate sum
of each digit,reverse the orignal number and display

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If memory is allocated to a class,when object of the class is created then how do we use the abstract class methods.coz v cant create obj of abstract class, only reference is created,when the abstract class data and members got the space in memory??

1818


different types of protocols.......?

1434


i want to do oracle certification..could any one pleas tell me what is the level 1 certification exam in oracle? how do we get dumps?

1536


What is the pressure in co2 cartridge in a DCP 5 kg extinguisher.

2820


what is the use of fact tables in your banking project doveleped with teradata?

1402






Write a test case plan for a typical banking application which involves functionalities like Balance enquiry, deposit, fund transfer etc. Make your assumptions and mention the same in your answer sheet.

1548


how to generate linked implementation of sparse matrix?

1493


why we use conio.h in c programming?

1669


Write a java program to print the subsets of a string

1950


2. A product selected for testing is equally likely to have been produced by one the 6 machines/processes. (i) Determine sample space ‘S’ (ii) What is the probability that the product is from machine 1? (iii) What is the probability that the product is from machine 2 or machine 4? (iv) What is the probability that the product is from both machine 5 and machine 3? (v) What is the probability that the product is not from machine 6? (vi) What is the probability that the product is not from either machine 6 or machine 1?

1516


What is the allowable load carrying capacity of a circular column section of 400 mm diameter reinforced with 6x25 mm diameter bars adequately tied with spirals? Consider concrete of grade M25 and steel of grade Fe 415.

1621


i want to know about the scope of IT engineers in ONGC

1684


Explain work?

578


In HSE what is Lost time accident? why it is to be reported within 48 hrs to gov.authorities ?

1403


who is your favourate actor in tollywood tellme about him in few points

2597