Remainder without using% operator
class Constructor{
public static void main(String[] args) {
//Declaration Of Variables
int num = 19,div = 2;
while(num>=div){
num -=div;
}
System.out.println("remainder is :"+num);
}
}
Output:remainder is :1
Remainder without using% operator
class Constructor{
public static void main(String[] args) {
//Declaration Of Variables
int num = 19,div = 2;
while(num>=div){
num -=div;
}
System.out.println("remainder is :"+num);
}
}
Output:remainder is :1
All Copyright © 2020 Are Reseved By Math Traders
No comments:
Post a Comment