







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








What Is an Array?
int day[ 7 ] = {6, 7, 8, 9, 10, 11, 12} ; declares a seven element array day and initializes (assigns values to) all seven of the elements.
day[0] is February 6, 2005 day[1] is February 7, 2005 day[2] is February 8, 2005 day[3] is February 9, 2005 day[4] is February 10, 2005 day[5] is February 11, 2005 day[6] is February 12, 2005
/* Program to generate an array of 10 random numbers / #include <stdio.h> #include <stdlib.h> #define SIZE 10 / SIZE defined as symbolic constant */ int main ( ) { int i, numbers [SIZE] ; for (i = 0 ; i < SIZE ; i++ ) { numbers[ i ] = rand ( ) ; printf ( "The number[ %d ] is %d \n", i, numbers[ i ]) ; } }
APPROACH