Learning to be precise
Submissions: 7251   Accuracy:

65.66%

  Difficulty: Easy   Marks: 2
Associated Course(s):   Fork CPP   Placement 100

There are times when your answer is a floating point that contains undesired amount of digits after decimal. Here, we'll learn how to get a precise answer out of a floating number. You are given two floating numbers a and b. You need to output a/b and decimal precision of a/b upto 3 places after the decimal point.

Note: You may use setprecision and fixed.

Input Format:
First line of input conatins number of testcases T. For each testcase, there will be one line of input containing a and b separated by a space.

Output Format:
For each testcase, print the required output.

User Task:
Your task is to complete the provided function.

Constraints:
1 <= T <= 10
1 <= a, b,<= 100

Input:
1
5.43 2.653

Output:
2.04674 2.047

** For More Input/Output Examples Use 'Expected Output' option **

Author: Soul_xhacker


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.