Day6 : Code on Assignment Operator

 Code on Assignment Operator

class Demo
{
public static void main(String [ ] args)
{
int a = 30, b = 10;
System.out.println("The Sum of a and b is "+ (a+b));
System.out.println("The Subtraction of a and b is "+ (a-b));
System.out.println("The Multiplication of a and b is "+ (a*b));
System.out.println("The Division of a and b is "+ (a/b));
System.out.println("The Remainder of a and b is "+ (a%b));
}
}

Output: Shown in figure



Comments

Popular posts from this blog

Day2 : Compiling Java Program with Examples

Day1: Introduction to Java and its feature

What does System.out.printf( "%-15s%03d\n", s1, x) do?