Write a program to accept 5 numbers from the user and check if their sum is greater than 500 numbers or not.
Answers
Answered by
0
Answer:
import Java. until*;
public class sum
{
public static void main ()
{
Scanner in = New Scanner (System .in);
int a , sum=0,num,num1,num2,num3,num4;
Input ("Enter five numbers");
sum= num+ num1+num2+num3+num4;
if (sum>500)
System.out.println("The"+ sum+" is greater than 500");
else
System.out.println ("The"+sum+"is not greater than 500");
}
}
Similar questions