Example 01-o5 solve are given by DEL.
Example_01:
Example_02:
Example_03:
Example_04:
public class Exampe_04 {
public static void main(String[] args) {
int a,b;
double c,d;
a = 10 / 3;
b = 10 % 3;
System.out.println("Result is 10/3 = "+a+"\tand reminder is = "+b);
c = 10.0/ 3.0;
d = 10.0 % 3.0;
System.out.println("Result is 10/3 = "+c+"\t and Reminder is = "+d);
}
}
Example_05:
public class Example_05 {
public static void main(String[] args) {
int b,d;
b = 2;
d = 10;
if(b!=0 & d%b==0)
System.out.println(b+" is a factor of "+d+" in & ");
if(b!=0 && d%b==0)
System.out.println(b+" is a factor of "+d+" in &&");
b=0;
if(b!=0 & d%b==0)
System.out.println(b+" is a factor of "+d+" in & ");
if(b!=0 && d%b==0)
System.out.println(b+" is a factor of "+d+" in &&");
}
}