/* This is the fourth lab of EE107.
The purpose of this lab is to understand how to code a
while loop to "feed in" numbers 1-5, and then plug them into
a math equation and character set.
The procedure of the lab was to take the given output in the slides,
and find a way to properly program a while loop that could take
an integer "n", multiply it with itself, and subtract the product.
Author: Jasmine Dezurn
StarID: vj0100jc
Date: September 30th, 2024
*/
void setup() {
Serial.begin(9600);
int n = 1;
while (n <= 5) {
Serial.print("n = ");
Serial.print(n);
Serial.print(", n^2 - 1 = ");
Serial.println((n * n)-1);
n++;
}
}
void loop() {
// put your main code here, to run repeatedly:
}