हिंदी

Given: int PM[] = {650, 525, 475, 325, 250, 175 }; for (int p = 5; p>=1 ; p--) System.out.print (" % “ + PM[p]%100); The output will be ______.

Advertisements
Advertisements

प्रश्न

Given:

int PM[] = {650, 525, 475, 325, 250, 175 };
for (int p = 5; p>=1 ; p--)
System.out.print (" % “ + PM[p]%100);

The output will be ______.

विकल्प

  • % 50, %2 5, %75, %25, %50, %75

  • % 75 % 50 % 25 % 75 % 25

  • 75 % 50 % 25 % 75% 25%

  • % 175 % 250 % 325 % 475 % 525

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

उत्तर

The output will be % 175 % 250 % 325 % 475 % 525.

Explanation:

The loop starts from index 5 and moves backward to index 1. For each element, the remainder after dividing by 100 is calculated using the modulus % operator. The results 75, 50, 25, 75, and 25 are printed, each preceded by the % symbol. Therefore, the output is % 75 % 50 % 25 % 75 % 25.

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

APPEARS IN

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

Englishहिंदीमराठी


      Forgot password?
Use app×