हिंदी

Some of the code given below contains errors. Identify the error and correct it. Write the output of the correct/corrected code. In the above code h(i), replace the array by int MW[] = {56, 21, 33,

Advertisements
Advertisements

प्रश्न

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

In the above code h(i),

replace the array by

int MW[] = {56, 21, 33, 78, 95};

कोड लेखन
Advertisements

उत्तर

int MW[] = {56, 21, 33, 78, 95};
boolean some = false;
for (int j = 0; j < MW.length; j++) 
{
    if (MW[j]/100 > 0) 
    {
        System.out.println("Some Value is :" + MW[j]);
        some = true;
        break;
    }
}
System.out.print("SOME =" + some);
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 7: Arrays - One Dimension - Exercises [पृष्ठ १७५]

APPEARS IN

रुपा पंडित Computer Applications [English] Class 10 ICSE
अध्याय 7 Arrays - One Dimension
Exercises | Q 3. (viii) (b) | पृष्ठ १७५
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×