please yaar help kar do.....answer it plzzzz...
Attachments:
QGP:
What is that line in if?
Answers
Answered by
1
Hey There!!!
Let us first analyze the code.
There is a while loop. The value of i starts from 1, and increments by 1 in each iteration. The loop breaks when i=5.
Using this info, we can write the code using for loop as follows:
for(int i=1;i<=5;i++)
{
if(i * i == 4)
jTextField1.setText(" "+i);
}
Hope it helps
Purva
Brainly Community
Let us first analyze the code.
There is a while loop. The value of i starts from 1, and increments by 1 in each iteration. The loop breaks when i=5.
Using this info, we can write the code using for loop as follows:
for(int i=1;i<=5;i++)
{
if(i * i == 4)
jTextField1.setText(" "+i);
}
Hope it helps
Purva
Brainly Community
Similar questions