Computer Science, asked by javedasjad07, 9 months ago

Write a program to input 10 numbers and print the largest number among all the inputted numbers.

Answers

Answered by Anonymous
10

Answer:

import java.util.*;

class Largest

{

public static void main()

{

Scanner sc=new Scanner(System.in);

int a[]=new int[10];

System.out.println("Enter 10 numbers");

for(int i=0;i<10;i++)

a[i]=sc.nextInt();

int large=a[0];

for(int i=0;i<10;i++)

if(large<a[i])

large=a[i];

System.out.println("Largest number : "+large);

}

}

Answered by Dalah
3

hope it will help you.

no need of thanks

Attachments:
Similar questions