हिंदी

What will be the output of the given Java code after the calculation [note the data types]? double cy = Math.ceil (Math.cbrt(0.125), Math.sqrt(0.64)); System.out.println("CY=" +cy);

Advertisements
Advertisements

प्रश्न

What will be the output of the given Java code after the calculation [note the data types]?

double cy = Math.ceil (Math.cbrt(0.125), Math.sqrt(0.64));

System.out.println("CY=" +cy);

लघु उत्तरीय
Advertisements

उत्तर

intended to use Math.max() or Math.min() (which do accept two arguments), here is how they would evaluate:

Inner Functions:

  • Math.cbrt(0.125) (cube root of 0.125) = 0.5
  • Math.sqrt(0.64) (square root of 0.64) = 0.8

Hypothetical Output:

  • If it were Math.max(0.5, 0.8), the output would be: CY = 0.8.
  • If it were Math.min(0.5, 0.8), the output would be: CY = 0.5.

shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 1: Revision of Class 9 Syllabus - Exercises [पृष्ठ ४६]

APPEARS IN

रुपा पंडित Computer Applications [English] Class 10 ICSE
अध्याय 1 Revision of Class 9 Syllabus
Exercises | Q 5. (ix) | पृष्ठ ४६
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×