|
CS256 - Principles of Structured Design
Fall 2021
|
Displaying ./code/cs256su21code/jun21/arrayRev.c
#include <stdio.h>
int main(){
//declares an array named "numbers" that can store up to 64 integers
int numbers[64] = {0}; //initalizes all values in the array to zero
/*
prints 64 zeroes
for(int i = 0; i < 64; i++)
printf("%d\n", numbers[i]);
*/
numbers[0] = 8; //assigns the value 8 at index 0
numbers[1] = 24; //assigns the value 24 at index 1
numbers[2] = 37; //assigns the value 37 at index 2
numbers[3] = -3; //assigns the value -3 at index 3
printf("%d\n", numbers[2]); //prints the value at index 2
return 0;
}
|