English

Some of the code given below contains errors. Identify the error and correct it. Write the output of the correct/corrected code. double FZ[] = {3.12, 4.64, 5.57, 6.23, 7.25); boolean asc = true;

Advertisements
Advertisements

Question

Some of the code given below contains errors. Identify the error and correct it. Write the output of the correct/corrected code.

double FZ[] = {3.12, 4.64, 5.57, 6.23, 7.25);
boolean asc = true;
for( int j = 0; j<= 3; j++)
{
     if(FZ[j] >FZ[j+1])
     {
         asc = false;
     }
}
System.out.print(" ASC =" + asc);
Very Short Answer
Advertisements

Solution

No Error. Output : ASC = true

shaalaa.com
  Is there an error in this question or solution?
Chapter 7: Arrays - One Dimension - Exercises [Page 174]

APPEARS IN

Rupa Pandit Computer Applications [English] Class 10 ICSE
Chapter 7 Arrays - One Dimension
Exercises | Q 3. (v) | Page 174
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×