Nathan works as an HR in a private company. He had an opportunity to interview students from various disciplines. He asked the candidates to perform the addition of two floating point numbers given by him an to print the output with three values after decimal point. But the student failed a math test on adding two numbers. So many students could not complete the first round.
One day Nathan is invited as a chief placement trainer in a reputed engineering college. He willing to know how many students are capable of solving the same problem.
Can you solve the problem and prove him that you are capable of solving it?
Input Format:
The only line of input has two input values of type float separated by a space.
Output Format:
In the only line of output print the sum of two numbers with three values after decimal point
Refer sample input and output:
Input: 19845.67 12985.59
Output: 32831.258
#include <stdio.h> int main() { float var1,var2,res; //printf("Enter two float numbers: "); scanf("%f%F",&var1,&var2); res=var1+var2; //printf("\nResult with three decimal point: "); printf("%.3f",res); return 0; }
Input_1:
Enter two float numbers: 19845.67 12985.59
Output:
Result with three decimal point: 32831.258
Input_2:
Enter two float numbers: 23985.12 6545.51
Output:
Result with three decimal point: 30530.629
Input_3:
Enter two float numbers: 2.22 3.22
Output:
Result with three decimal point: 5.440
Input_4:
Enter two float numbers: 6.432 600.1
Output:
Result with three decimal point: 606.532
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.