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
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?