public class AddMul{
public static void main(String [] args){
int n1=5, n2=6, n3=4, n4=9, r1=0, r2=0;
r1=n1+n2+n3+n4;
System.out.println("Sum of 4 integer numbers is:"+r1);
r2=n1*n2*n3*n4;
System.out.println("Product of 4 integer numbers is:"+r2);
double num1=5, num2=6, num3=4, num4=9, r3=0, r4=0;
r3=num1+num2+num3+num4;
System.out.println("Sum of 4 double numbers is:"+r3);
r4=num1*num2*num3*num4;
System.out.println("Product of 4 double numbers is:"+r4);
}
}
public static void main(String [] args){
int n1=5, n2=6, n3=4, n4=9, r1=0, r2=0;
r1=n1+n2+n3+n4;
System.out.println("Sum of 4 integer numbers is:"+r1);
r2=n1*n2*n3*n4;
System.out.println("Product of 4 integer numbers is:"+r2);
double num1=5, num2=6, num3=4, num4=9, r3=0, r4=0;
r3=num1+num2+num3+num4;
System.out.println("Sum of 4 double numbers is:"+r3);
r4=num1*num2*num3*num4;
System.out.println("Product of 4 double numbers is:"+r4);
}
}
No comments:
Post a Comment