मराठी

Some of the code given below contains errors. Identify the error and correct it. Write the output of the correct/corrected code. int MW[ ] = {21, 56, 31, 459, 52, 742, 26}; boolean some = false; for

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 MW[ ] = {21, 56, 31, 459, 52, 742, 26};
boolean some = false;
for(int j = 0; j <MW.length; j++)
{
    if (MW[j]/100 > 0)
    {
        System.out.print("Some Value is :" + MW[j]);
        some = true;
        break;
    }
}
System.out.print(" SOME = " + some);
अति संक्षिप्त उत्तर
Advertisements

उत्तर

No Error. Output: Some Value is : 459 SOME = true

shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 7: Arrays - One Dimension - Exercises [पृष्ठ १७५]

APPEARS IN

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

Englishहिंदीमराठी


      Forgot password?
Use app×