Learning To Code #3

in #coding4 years ago (edited)

Today I decided that sometimes I should post some exercises that helped me a lot while learning basic stuff. Once I wanted to learn more about Arrays so I asked for an exercise from my programmer friend who has helped me a lot.

Array exercise 1:

  1. Make an array where are 10 random numbers.
  2. Ask the user for a number.
  3. Make an array where are all the numbers from the first array that are smaller than the given number.

Output should be (example):
array.png

Array exercise 2:

  1. Make an array where are 10 random numbers.
  2. Ask the user for a number.
  3. Make an array where are all the numbers from the first array until the number that the user gave you is smaller than the next number on the array.

Output should be (example):
1.png

Another example:
test.png

If you got any questions feel free to hit me up!🤓

Tips: To get the size for the second array try to use loop.