The following is the program segment of a JAVA program: amount = 100 while (i>0) { System.out.println(amount); amount = amount - 1; } Rewrite the above using DO-WHILE.
Advertisements
प्रश्न
The following is the program segment of a JAVA program:
amount = 100
while (i>0)
{
System.out.println(amount);
amount = amount - 1;
}
Rewrite the above using DO-WHILE.
कोड लेखन
Advertisements
उत्तर
The given Java program segment, rewritten using a DO-WHILE is:
amount = 100;
DO
{
System.out.println(amount);
amount = amount - 1;
}
WHILE (i > 0);
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
