Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
easy Solved by 17 students

Type Casting in Division

< Prev
Next >

What is printed when the following code segment is executed?

public class Main {
    public static void main(String[] args) {
        int a = 7;
        int b = 2;
        double result = a / (double) b;
        System.out.println(result);
    }
}
A

3

B

3.0

C

3.5

D

Runtime Error

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question
Mark for review

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Total Time
Score
#1ravi.palepu11 0m 00s 100
#2anusha.ghadge11 0m 00s 100
#3songqiuhui201211 0m 04s 96
#4kazvin.tjakradinata11 0m 06s 94
#5patrickmeijer00911 0m 12s 88
#6parth.taur22711 0m 13s 87
#7701704611 0m 18s 82
#8leftoverjluck11 0m 21s 79
#910818526511 0m 43s 57
#10y.seong202711 0m 44s 56
Items per page:
10
1 – 10 of 14
No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy|FAQ