How can i Add two number without any operator in java???
Answers
Answered by
0
Answer:
it is not possible to add two or more numbers without using an operator. so no.
Answered by
0
Yes, it is not possible with Math.addExact() function.
Your Program:
package com.company;
import java.util.Scanner;
class test
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter first number: ");
long n1 = sc.nextLong();
System.out.println("Enter second number: ");
long n2 = sc.nextLong();
System.out.println("The sum of the numbers: "+Math.addExact(n1,n2));
}
}
Similar questions