Answer C7


#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
  if ( argc == 2 )
  {
    int x = atoi( argv[1] );
    if ( x%2 == 1 )
      printf( "%d is odd\n", x );
    else
      printf( "%d is even\n", x );
  }
  return 0;
} 

The program returns without any message if there is no parameter. It does not test for mistaken input:



Back to Puzzle Home