Lab6A: Largest of 10 For this lab, please use a for loop. They may seem a little more intimidating at first, but they are actually quite simple to set up. The goal of this exercise is for you to create a program that will ask the user to input 10 positive integer numbers, one at a time. While it does this the program should also keep track of the largest number it has seen so far. After it has run 10 times, it should display the largest number you inputted. Remember, the class name should be Lab6A. The user input is indicated in bold. Sample output: Please enter 10 numbers and this program will display the largest. Please enter number 1: 50 Please enter number 2: 51 Please enter number 3: 10 Please enter number 4: 1 Please enter number 5: 99 Please enter number 6: 1000 Please enter number 7: 1010 Please enter number 8: 42 Please enter number 9: 89 Please enter number 10: 1000 The largest number was 1010
Types of Loop
Loops are the elements of programming in which a part of code is repeated a particular number of times. Loop executes the series of statements many times till the conditional statement becomes false.
Loops
Any task which is repeated more than one time is called a loop. Basically, loops can be divided into three types as while, do-while and for loop. There are so many programming languages like C, C++, JAVA, PYTHON, and many more where looping statements can be used for repetitive execution.
While Loop
Loop is a feature in the programming language. It helps us to execute a set of instructions regularly. The block of code executes until some conditions provided within that Loop are true.
Need help typing and figuring out this
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images