मराठी

Some of the code given below contains errors. Identify the error and correct it. Write the output of the correct/corrected code. int GY[] = {3.12, 4.64, 5.57, 6.23, 7.25}; boolean desc = true;

Advertisements
Advertisements

प्रश्न

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

int GY[] = {3.12, 4.64, 5.57, 6.23, 7.25};
boolean desc = true;
for(int j = 0; j<=3; j++)
 {
    if(GY[j]>GY[j+1])
    {
        desc = false;
     break;
 }
}
कोड लेखन
Advertisements

उत्तर

double GY[] = {3.12, 4.64, 5.57, 6.23, 7.25};
boolean desc = true;
for (int j = 0; j <= 3; j++)
{
    if (GY[j] > GY[j+1]) 
    {
        desc = false;
        break;
    }
}
System.out.print("desc =" + desc);
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 7: Arrays - One Dimension - Exercises [पृष्ठ १७४]

APPEARS IN

रूपा पंडित Computer Applications [English] Class 10 ICSE
पाठ 7 Arrays - One Dimension
Exercises | Q 3. (vi) | पृष्ठ १७४
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×