Computer Science, asked by angelicsoul482, 6 months ago

Write a program in Java to enter 10 numbers one by one and find. print the largest number entered and total of all the number​

Answers

Answered by BrainlyProgrammer
2

Answer:

int max=0,s=0;

for(I=1;I<=10;I++)

{

System.out.println("Enter a no.");

n=Sc.nextInt();

s+=n; //finding sum

if (max<n) //check if max if less than number

max=n;

}

System.out.println ("Sum="+s);

System.out.println("Largest number"+max);

Similar questions