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

Feb 24, 2025 - 20:42
 0
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<40) {
            police=police+5;
            thief=thief+2;
        }
        System.out.println(police);

        }

    }





output:
40