int n, s;

n=s=0;

 

while (s<100) {

n++;

s+=n;

}

System.out.printf("n = %d, s = %d\n", n, s);

===============================================

do{

n++;

s+=n;

} while(s<100);

System.out.printf("n = %d, s = %d\n", n, s);

===============================================

 

+ Recent posts