Rathik_1 organized technical round interview in Macrosoft for the set of computer science candidates.The problem is to perform addition, subtraction, multiplication, and division of given two numbers. Rathik_1 have given the deadline of only 5 minutes to complete the problem.
Input:
The only line of input has two numbers a and b of type integers separated by a comma.
Output:
Print Addition, Subtraction, Multiplication, Division, and Modulus of given two numbers in a separate line respectively.
Note: Rathik_1 instructed his candidates to print the result of the division with 3 values after decimal point.
#include <stdio.h> int main() { int testnum1,testnum2; int sum,sub,mult,mod; float div; scanf("%d",&testnum1); scanf("%d",&testnum2); sum=testnum1+testnum2; sub=testnum1-testnum2; div=(float)testnum1/(float)testnum2; mult=testnum1*testnum2; mod=testnum1%testnum2; printf("\nAddition : %d",sum); printf("\nSubtraction : %d",sub); printf("\nMultiplication : %d",mult); printf("\nDivision : %0.3f",div); printf("\nModulus : %d",mod); return 0; }
Input_1:
17 13
Output:
Addition : 30
Subtraction : 4
Multiplication : 221
Division : 1.308
Modulus : 4
Input_2:
31 4
Output:
Addition : 35
Subtraction : 27
Multiplication : 124
Division : 7.750
Modulus : 3
ILLUSTRATION
Morae Q!
- Convert seconds to hours – HMS format.
- Find out the tax amount of the bill with tip for the meal.
- Find the area of the pyramid.
- Find the area of triangle using heron’s formula.
- Find the interest and amount resided in the bank.
- Convert the travel days to years and months.
- Find the first three powers of N number.
- Compute the height from feet and inches to centimetres.
- Calculate the amount of interest earned in the bank.
- Find the ways they can choose the sequence of dummy statues.
- Find the Lapindrome strings.
- Classify the salary of a person.
- Find the day on providing the week number.
- Find the least number of marble stones needed to pave the square mall.
- Find the number of steps on chessboard performed to satisfy a condition.
- Find the time, hours and minutes the train was delayed.
- Find the quantity of food packets shared and available.
- Compute all Arithmetic Operations.
- Find the amount to pay for the electricity bill.
- Find the sum of numbers with three values after decimal point.