Dremendo Tag Line

Print sum of 2 integer numbers in Java

Java Output - Question 6

In this question, we will see how to print the sum of 2 integer numbers in java programming using the java output. To know more about java output click on the java output lesson.

Q6) Write a program in java to print the sum of 2 integer numbers like int a=7, b=13.

Program

public class Q6
{
    public static void main(String args[])
    {
        int a=7,b=13;
        System.out.println("Sum=" + (a+b));
    }
}

Output

Sum=20
video-poster