Important Java Mcq 1

The expression (int)(76.0252175 * 100) / 100 evaluates to

a. 76

b. 76.0252175

c. 76.03

d. 76.02

Answer:

 a. 76

Explanation:

Firstly, 76.0252175 is multiplied by 100 we get the result as 7602.52175. Now the result is divided by 100 we get 76.0252175, before this mathematical statement there is a special term i.e., (int) which means whatever value we get must be converted to an integer type. This process is known as type casting so 76.0252175 is converted to int i.e., 76!

Related MCQs

Which statement is true about Java?

a) Java is a sequence-dependent programming language b) Java is a code dependent programming language c) Java is a platform-dependent programming language d) Java is

Aniket Malik

Aniket Malik

CERTIFIED TUTOR/TRAINER WITH 300+ REVIEWS

Facing difficulty with

this concept?