/* segFault2.c  P. Conrad 9/16/05

This file should make a segmentation fault
because we do a printf on an integer using
the %s instead of the %d format specifier.

*/

#include <stdio.h>

int main(void)
{
  int x; /* this is a declaration for the variable x */

  x = 1; /* this is an assignment statment */

  /* since that was the "first" assignment to x, it
     might be consider the "initial" assignment to x,
     therefore it is sometimes called the "Initialization" */


  printf("enter value for x:");
  scanf("%d",&x);  

  printf("This printf will work normally: x=%d\n",x);

  printf("The next printf will probably bomb out\n");
  
  printf("x=%s\n",x); /* %s should be %d */

  return 0;

}

