100 Days of Java challenges

Day 10 - Loops (for, while, do-while)

1. Write a program that reads an input integer 'n' and prints the sum of integers from 1 to 'n' using three different types of loops: for, while, and do-while loops.
2. Write a program that reads an input integer 'n' and prints the sum of even integers from 1 to 'n' (use continue).
3. Write a program that generates random numbers between 1 and 100 until it finds a number divisible by both 5 and 7. When the number is found, print it and terminate the loop using the break statement.

      Blog|Youtube|Careers|Contact Us
      Have Feedback or want to contribute? Email: hello[@]100DaysOfCode.io
      100DaysOfCode@2024