हिंदी

Given: int AM[]= {3, 6, 12, 24, 48 96}; for (int p= 3; p<6 ; p++) System.out.print ("*" + AM[p]/2); The output will be ______.

Advertisements
Advertisements

प्रश्न

Given:

int AM[]= {3, 6, 12, 24, 48 96};
for (int p= 3; p<6 ; p++)
System.out.print ("*" + AM[p]/2);

The output will be ______.

विकल्प

  • * 6 * 12 * 24 * 48

  • * 12 * 24 * 48

  • 12 * 24 * 48 *

  • * 24 * 48 * 96

MCQ
रिक्त स्थान भरें
Advertisements

उत्तर

The output will be * 12 * 24 * 48.

Explanation:

The loop starts from index 3 and continues up to index 5. It accesses the elements 24, 48, and 96 of the array. Each element is divided by 2, resulting in 12, 24, and 48. These values are printed with an asterisk (*) before each value. Hence, the output is *12*24*48.

shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 7: Arrays - One Dimension - Exercises [पृष्ठ १७३]

APPEARS IN

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

Englishहिंदीमराठी


      Forgot password?
Use app×