]Hi, I have to make a program that ask the user how many numbers he want to calculate the square of (f. example, if the user types 4 the program will show the square of 0, 1, 2 and 3). I was specifically ask to do it using an array.
I manege to do it with a normal loop but i tried to use an array all i get is errors... does anyone have an idea please?
Any explanation or trick about arrays are more than welcome
void setup()
{
    Serial.begin(9600);
Serial.setTimeout(100);
 Serial.println("How many squares?");
}
void loop()
{
if (Serial.available()
  {
   int Squares = Serial.parseInt();
   Serial.println(Squares);
   int Array[Squares];
   Serial.println("Answer: ");
   for (int i = 0; i < Squares ; i++)
   {
 Â
Serial.println(i*i);
   }
Serial.println();
  }
}