Question: Please use Java, Thank you. 5-1 Write a program with a loop that iterates as long as an int variable called num is less or
Write a program with a loop that iterates as long as an int variable called num is less or equal to 50. Num must be initialized with a value of 1 and incremented by 1 with each iteration. Each iteration of the loop must print all appropriate sentences for that number according to the following: 1. If num is odd, output: num is an odd number 2. If num is even, output: num is an even number 3. If num is divisible by 2 , output: num is divisible by 2 4. If num is divisible by 5 , output: num is divisible by 5 5. If num is divisible by 8 , output: num is divisible by 8 6. If num is divisible by 11 , output: num is divisible by 11 Please note that your class should be named FirstLoop
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
