Professional Documents
Culture Documents
looping Questions Int P 1, S 0 While (P++ 15) (P++ S S+P System - Out.println (P) ) System - Out.println(s)
looping Questions Int P 1, S 0 While (P++ 15) (P++ S S+P System - Out.println (P) ) System - Out.println(s)
int p=1,s=0;
while(p++ <15)
{
p++;
s=s+p;
System.out.Println(p);
}
System.out.Println(s);
p s
3 3
5 8
7 15
9 24
11 35
13 48
15 63
Answer= 3,5,7,9,11,13,15,63