Data Types - Java
Submissions: 11862   Accuracy:

50.31%

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

Working with Data Types is very important in programming world. Here, we will learn to manipulate the basic data types in Java. You will be given four different variables of different data types: a (int), b (float), c (double), l (long), d (byte). Your task is to do step-wise operations as given below:
1. Divide c by b.
2. Divide b by a.
3. Divide c by a.
4. Add result at step 3 with l.
5. Divide a by d.

Input Format:
First line of input conatins number of testcases T. For each testcase, there will be one line of input: a, b, c, l, and d.

Output Format:
For each testcase, print the required output as directed in steps in a single line.

User Task:
Your task is to complete the provided function dataTypes() following the above given steps.

Constraints:
1 <= T <= 10
1 <= a, b, c <= 106

1 <= d <= 127
1 <= l <= 1018

Input:
1
1 2 3 5 127

Output:
1.5 2.0 3.0 8.0 0

Example:
Testcase 1: a=1, b=2, c=3, l=5, d=127
c/b=3/2=1.5
b/a=2/1=2.0
c/a=3/1=3.0
(c/a)+l=8.0
a/d=1/127=0

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

Author: Dhiman Mayank


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.