98-388 Exam QuestionsBrowse all questions from this exam

98-388 Exam - Question 25


DRAG DROP -

Your instructor asks you to evaluate four arithmetic code segments.

What is the value of each code segment? To answer, drag the appropriate value from the column on the left to its code segment on the right. Each data may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.

Select and Place:

Exam 98-388 Question 25
Show Answer
Correct Answer:
Exam 98-388 Question 25

Discussion

2 comments
Sign in to comment
MuzM
Jun 25, 2020

it should be 2.5 not 2 for the last one

Tybs
Sep 2, 2020

2 is correct. Since the value of 5/2 (2.5) is never stored in a double or float, the result will be rounded down to 2. Try it out with the following code: public static void main(String[] args) { System.out.println(5/2-4%2); }

Abhitera
Feb 10, 2021

Good explanation

Abhitera
Feb 10, 2021

Good explanation

adrian_kurek
Jun 17, 2021

dont comment if u dont know the answer idiot

Girul
Oct 15, 2021

// Try it! System.out.println((2+3)*4-1); System.out.println(4*4+2*5); System.out.println(8*2%3); System.out.println(5/2-4%2); 19 26 1 2

johnhartman1968
Jan 19, 2021

2 for the last answer. Tested in code. An integer is returned, which drops the .5