Puzzle SL42

Slight Change. Does it make a Difference?


/* --- sumVersion2.c --- */
#include <stdio.h>
 
void main()
{ 
  const int N = 10;
  
  int sum;
  int j;
  for ( j=1; j<=N; j++ )
    sum += j;

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

Note the slight change in the declaration of sum.

What does the code write to the monitor?



Previous Page        Answer         Next Page         Home