# include int main ( ) { int i; int n; printf ( "Enter N, the size of the array you want:" ); scanf ( "%i", &n ); // // Although we normally put the declarations at the beginning of a program, // we are actually allowed to put them almost ANYWHERE, as long as they // occur before we first use the variable. // // So we could declare "int a[10]" right here, even though we've already // done two executable statements, PRINTF and SCANF. // // What is more interesting is that we can declare the array A to be of size // N, where the value of N has just been entered by the user. // int a[n]; for ( i = 0; i < n; i++ ) { a[i] = i * i; } printf ( "\n" ); printf ( " I A[I]\n" ); printf ( "\n" ); for ( i = 0; i < n; i++ ) { printf ( "%2i %4i\n", i, a[i] ); } return 0; }