Puzzle SL43

More changes:


/* --- sumVersion3.c --- */
#include <stdio.h>

const int N = 10;
int sum;
int j;
 
void main()
{ 
  for ( j=1; j<=N; j++ )
    sum += j;

  printf( "sum: %d\n", sum );    
}

Now the variables and the constant are "global", that is: file scope, external linkage, implemented in static memory (not on the stack.)

What does the code write to the monitor?



Previous Page        Answer         Next Page         Home