Q. What will be the output?

Code:
System.out.println(Math.round(2.5));
  • (A) 2
  • (B) 3
  • (C) 2.5
  • (D) Compilation Error
πŸ’¬ Discuss
βœ… Correct Answer: (B) 3
Explanation: Math.round rounds to nearest integer.
Explanation by: Roshan
Math.round rounds to nearest integer.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
36
Total Visits
πŸ“½οΈ
5 mo ago
Published
πŸŽ–οΈ
Roshan
Publisher
πŸ“ˆ
90%
Success Rate