Computer Science, asked by naushadahmad2689, 8 months ago

rewrite the following for loop using while loop
int p=20;
for (k=p;k>=0;k-=2)
{
S+=k;
}
System.out.println("Sum="+s);​

Answers

Answered by devansh223
2

Answer:

int p=20;

int k= p;

while(k>=0)

{

S+ = k;

k-=2;

}

system.out.println("Sum="+S);

Similar questions