Program to determine the largest of n numbers.
n=int(input("Enter limit"))
num=int(input("Enter a number"))
l=num
for i in range(n):
num=int(input("Enter a number"))
if num>l:
l=num
print(l)
Program to determine the average age of students in a class. The user will stop
giving the input by giving the age as 0
age=int(input("Enter Age"))
count=0
sum=0
while(age!=0):
count=count+1
sum=sum+age
age=int(input("Enter Age"))
avg=sum/count
print("Average age is: ",avg)
Program to find the factorial of a number.
n=int(input("Enter a number"))
f=1
for i in range(1,n+1):
f=f*i
print("factorial is: ",f)