int number1 = 5;
int number2 = 10;
int number3 = 15;
int number4 = 20;
I'm going use a for-loop that goes from 2 to 5.
Inside the for-loop, the numbers must be given a new value by multiplying with the value from the for-loop (they SHOULD use the value that the for-loop creates).
E.g: When for-loop has the value 2, number1 must be multiplied by the for-loop's value 2. When the for-loop has the value 3, number2 must be multiplied by the for-loop's value 3 etc.
The new value should also be printed inside the for loop right after multiplication has been performed for each of the numbers.
Does anyone have a good example? I was looking in the Arduino.cc -> Built-In examples -> For loops with arrays, but that is not what I'm looking for.
2 times 5 equals 10
2 times 10 equals 20
2 times 15 equals 30
2 times 20 equals 40
3 times 5 equals 15
3 times 10 equals 30
3 times 15 equals 45
3 times 20 equals 60
4 times 5 equals 20
4 times 10 equals 40
4 times 15 equals 60
4 times 20 equals 80
5 times 5 equals 25
5 times 10 equals 50
5 times 15 equals 75
5 times 20 equals 100
I'm looking for an example that will give the following output:
2 times 5 equals 10 and print out 10
3 times 10 equals 30 and print out 30
4 times 15 equals 60 and print out 60
5 times 20 equals 100 and print out 100
It is easy to understand and has a good mixture between explaining important concepts and example-codes to get you going. So give it a try and report your opinion about this tutorial.