How to take long input in java programming


package SolveProblem;

import java.util.Scanner;

public class TakeLongInput {

    public static void main(String[] args) {
        Scanner myScanner=new Scanner(System.in);
       
        long a,b;
        System.out.println("Enter two Long integer value : ");
        a=myScanner.nextLong();
        b=myScanner.nextLong();
       
        System.out.println("Solution of two long integer number is : "+(a+b));
    }

}

//Enter two Long integer value :
//4 4
//Solution of two long integer number is : 8

No comments:

Post a Comment