Computer Science, asked by rk962864, 10 months ago

wap using for loop to find the greatest given 10 number​

Answers

Answered by aryan071003
0

Answer:

Explanation:please elabourarte

Answered by AskewTronics
0

Program in python:

Explanation:

number=[1,2,3,45,50,6,7,8,9,10]#list of numbers

greatest=number[0]#variable which holds the gratest number.

for x in number:#for loop which comapre the greatest number.

    if x>greatest:

        greatest=x

print(greatest)#print the greatest value.

Output:

  • The above code will print 50 as a greatest number.

Code Explantion:

  • The above code contains a list of numbers which can be changed by the user.
  • Then there is a for loop which scans all the element of the list and then compare the element to find the greatest.

Learn More:

  • Python : https://brainly.in/question/14689905
Similar questions