// Pantea Aria // static arrays, declare, initialise, read, print // when you need to store multiple values of the same type #include int main(void) { //declare an int array of size 5 int numbers[5]; // assign values to all elements numbers[0] = 10; numbers[1] = 20; numbers[2] = 30; numbers[3] = -90; numbers[4] = 0; // print out the first and third values from your array printf("%d %d", numbers[0], numbers[2]); // input integers into the first two elements of array printf ("Enter the first and second numbers:"); scanf("%d %d", &numbers[0], &numbers[1]); // read 5 new integers into this array int i = 0; printf ("Enter 5 ints:"); while (i < 5) { scanf("%d", &numbers[i]); i++; } // print out all elements of the array // don't forget to return to the first index // or use another variable int j = 0; i = 0 ; while (i < 5) { printf ("%d ", numbers[i]); i++; } printf ("\n"); return 0; }