Wednesday 27 July 2016

Q.5 Devide two Numbers without Using *,/,% operators print quotient,Reminder 
public class DevideNum {
    public static void main(String[] args) {
        int a=54,b=5,c=0;
        while(b<=a){
            a=a-b;
            c++;
        }
        System.out.println("Reminder"+a);
        System.out.println("Quotient"+c);
    }
}

No comments:

Post a Comment

Featured post

All Logical Questions are Answered JumpInToIt