police thief while using "logical thinking"
package hlo; public class While { public static void main(String[]args) { int police=0; int thief=40; while(police

package hlo;
public class While {
public static void main(String[]args) {
int police=0;
int thief=40;
while(police<40) {
police=police+5;
thief=thief+2;
}
System.out.println(police);
}
}
output:
40