Advertisements
Advertisements
प्रश्न
Rewrite the program by using while loop:
int a, b=0, c;
System.out.println("The numbers are:");
for (a = 1; a <= 10; a++)
{
c = b * b;
System.out.print(c);
b = b + 1;
}
संक्षेप में उत्तर
उत्तर
int a = 1, b = 0, c;
System.out.println("The numbers are:");
while (a <= 10)
{
c = b * b;
System.out.print(c);
a = a + 1;
b = b + 1;
}
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?