java program to add two numbers

Java program to add two numbers


public class Add {
    public static void main(String args[])
        int a=5, b=10;
        int c;
        c= a + b;
        System.out.printf("Sum of a:%d and b:%d is:%d%n", a, b, c);
        //we can also use this- System.out.println("Sum of a:" +a+ " and b:"+b+" is:"+c);


About the Author: Make toss

Leave a Reply

Your email address will not be published. Required fields are marked *