Question: What are the outputs for the codes below? Also, how do I know for #1 and #3 if they are double or int? 1. System.out.print(15.7

What are the outputs for the codes below? Also, how do I know for #1 and #3 if they are double or int?

1. System.out.print(15.7 % 5);

a. .7

b. .3

c. 3

d. 0

e. 12

2. double x = 5 / 3;

System.out.print(x);

a. 0

b. 1

c. 1.66

d. 1.0

e. 2

3. System.out.print(9/11);

a. .8

b. 1

c. 2

d. 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!