write a program in JAVA to input the following number in a single dimensional array and find out the highest marks : 78,25,58,77,91
please please please don't spam for points
I really need the answer it's a very very important question
Answers
Answered by
0
Answer:
import java.util.Scanner;
public class Numbers {
public static void main(String[] args) {
int num1, num2,num3,num4,num5;
Scanner ip = new Scanner(System.in);
System.out.print("Enter num1: ");
num1 = ip.nextInt();
System.out.print("Enter num2: ");
num2 = ip.nextInt();
System.out.print("Enter num3: ");
num3 = ip.nextInt();
System.out.print("Enter num4: ");
num4 = ip.nextInt();
System.out.print("Enter num5: ");
num5 = ip.nextInt();
if (num1 > num2)
System.out.println(num1 + " is greater that " + num2);
else if (num2 > num1)
System.out.println(num2 + " is greater that " + num1);
Similar questions
Social Sciences,
4 months ago
English,
4 months ago
Hindi,
4 months ago
Physics,
9 months ago
English,
9 months ago
Computer Science,
1 year ago
Math,
1 year ago