हिंदी

Consider the program segment: int p=0; for(p=4 ; p>0 ; p- =2); System.out.print(p); System.out.println(p); The above statements will display: - Computer Applications

Advertisements
Advertisements

प्रश्न

Consider the program segment:

int p=0;
for(p=4 ; p>0 ; p- =2);
System.out.print(p);
System.out.println(p);

The above statements will display:

विकल्प

  • 42

  • 4200

  • 0
    0

  • 00

MCQ
Advertisements

उत्तर

00

Explanation:

Since there are no statements in the loop, no values of p are printed inside the loop. When the loop ends p has become 0. The last two print statements print the value of p, that is 00.

shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
2024-2025 (March) Official Board
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×