πŸ“Š JAVA
Q. What is the output of the following code?
Code:
int x = 5;
int y = 3;
System.out.println(x % y);
  • (A) 1
  • (B) 1.67
  • (C) 1.5
  • (D) 2
πŸ’¬ Discuss
βœ… Correct Answer: (D) 2

Explanation: The modulus operator (%) returns the remainder of integer division. In this case, 5 divided by 3 has a remainder of 2, which is printed to the console.

Explanation by: Pushkar
The modulus operator (%) returns the remainder of integer division. In this case, 5 divided by 3 has a remainder of 2, which is printed to the console.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
207
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Pushkar
Publisher
πŸ“ˆ
86%
Success Rate