Printing values divisible by 7
Exercise Type: Implementation
Instructions
Part 1
Using a while()
loop, write a bit of code that prints out all values between 1 and 1000, but only when they are divisible by 7!
Part 2
Based on the code that you just wrote, write a function that allows you to print out all values up to a positive integer (n) that are divisible by an integer (x)!
name: | Multiples() |
arguments: | x : the numbers will be multiples of |
n : the largest number that can be printed | |
return: | - |