Skip to content

boolean-uk/java-for-loop-exercise

Repository files navigation

Java For Loops

Tasks

  1. Write a function to return an array containing the natural numbers from 1 to n.

  2. Write a function to return an array containing the natural numbers from 1 to n in reverse.

  3. Write a function to return an array containing the answers to a given times-table (given n return the n times table).

  4. Write a function to return an array containing the reverse of a given times-table (given n return the reverse of the n times-table).

  5. Write a function to return an array containing the letters in order from a to z.

  6. Write a function to return an array containing the letters from Z to A

  7. Write a function to return an array containing all even numbers between 1 and n.

  8. Write a function to return an array containing all odd numbers between 1 and n

  9. Write a function to return the sum of all natural numbers between 1 to n.

  10. Write a function to return the sum of all even numbers between 1 to n.

  11. Write a function to return sum of all odd numbers between 1 to n.

  12. Write a function to return an array containing the letters between two ASCII values (which are arguments to the function).

  13. Write a function to return the factorial value of any number.

  14. Write a function to return an array containing the first n Fibonacci values.

  15. Write a function to return a number made up of the reversed digits of the given number (1973 -> 3791, and 1900 -> 91).

  16. Write a function to return the sum of the digits of a given number (1973 -> 20).

  17. Write a function to check whether a given number is prime or not.

  18. Write a function that will return the Highest Common Factor of two given numbers.

  19. Write a function that will return the Lowest Common Multiple of two given numbers.

  20. Write a function to return an array containing all of the multiples of 9 between two numbers.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages