मराठी

Convert the following while loop to the corresponding for loop: int m = 5, n = 10; while (n >= 1) { System.out.println(m*n); n--; }

Advertisements

प्रश्न

Convert the following while loop to the corresponding for loop: 

int m = 5, n = 10;
while (n >= 1)
{
System.out.println(m*n);
n--;
}
थोडक्यात उत्तर
टीपा लिहा
Advertisements

उत्तर १

for (int m=5, n=10; n>=1; n – – )
{
System.out.println (m*n);
}

shaalaa.com

उत्तर २

int n, m = 5; 
for (n = 10; n >= 1; n--) 
System.out.println(m * n); 
shaalaa.com
Introduction of Nested Loop
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 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 8. | पृष्ठ १२१
Advertisements
Share
Notifications



      Forgot password?
Use app×