हिंदी

Find the errors in the following program snippet: for (int k = 1; k <= 10; k--) System.out.println(k); - Computer Applications

Advertisements
Advertisements

प्रश्न

Find the errors in the following program snippet: 

for (int k = 1; k <= 10; k--) 
      System.out.println(k);
एक पंक्ति में उत्तर

उत्तर

In the loop, the update expression should be k++.

shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 1.09: Iterative Constructs in Java - Review Insight [पृष्ठ १२०]

APPEARS IN

अविचल Computer Applications [English] Class 10 ICSE
अध्याय 1.09 Iterative Constructs in Java
Review Insight | Q 6. | पृष्ठ १२०
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×