write the program to print the sum of two negative numbers
Answers
Answered by
0
JAVA PROGRAM :-
import java.util.Scanner;
public class Print
{
public static void main()
{
Scanner in=new Scanner(System.in);
int a,b,sum;
System.out.println("Enter two numbers :");
if (a<0)
sum = (a+b);
System.out.println("sum of those numbers ="+sum);
}
}
[NEGATIVE MEANS LESS THAN ZERO, EXAMPLE : -1, -2, -3 , -4
import java.util.Scanner;
public class Print
{
public static void main()
{
Scanner in=new Scanner(System.in);
int a,b,sum;
System.out.println("Enter two numbers :");
if (a<0)
sum = (a+b);
System.out.println("sum of those numbers ="+sum);
}
}
[NEGATIVE MEANS LESS THAN ZERO, EXAMPLE : -1, -2, -3 , -4
MaverickMani:
where are we getting inputs??
Similar questions