Puzzle SL44

More changes:


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

const int N = 10;
 
void main()
{ 
  int j;
  static int sum;
  
  for ( j=1; j<=N; j++ )
    sum += j;
    
  printf( "sum: %d\n", sum );    
 
}

Another change in the declaration of sum.

What does the code write to the monitor?



Previous Page        Answer         Next Page         Home