Write a program to enter n integers( the value of n to be input by the user). Display the maximum number and the minimum number input by the user. The program should terminate if the input is 0 (zero).
Answers
Answer:
hello,
its using python
Explanation:
n=int(input("enter the limit"))
l=[]
for i in range(n):
m=int(input("enter the number"))
if m==0:
break
else:
l.append(m)
print(max(l),"is the maximum")
print(min(l),"is the minimum")
hope it helps you
please mark brainliest
@ItzSnowySecret07
the ans in java :
import.java.util.* ;
class s1up_/
{ void main ()
{ int aup = 0 ;
scanner Sc = new scanner (system.in ) ;
system.out.println ( " enter the no. of integers to b entered " ) ;
int n = sc.nextInt () ;
int S [] = new Int [n] ;
system.out .println ("enter members") ;
for ( int i = 0 ,i< n , i++ )
{int S [i] = sc.nextInt() ; }
for ( int i = 0 ,i< n , i++ )
{if ( S[i] > aup )
aup = S[i] ;
else
int t = S [i] ;
}
for ( int i = 0 ,i< n , i++ )
{ system.out.println ( "highest of the lot " + aup + "\n" + "lowest of the lot " + t ) ; } }}
s1up✓