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

This file should make a segmentation fault
becuase we do a scanf without the & 

*/

#include <stdio.h>

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

  x = 1; /* this is an assignment statment */
  y = 1; /* this is an assignment statment */
  z = 1; /* this is an assignment statment */
  w = 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);  /* should be &x */

  printf("x=%d\n",x);

  printf("enter value for y:");
  scanf("%d",&y);  /* should be &y */

  printf("y=%d\n",y);

  printf("enter value for z:");
  scanf("%d",z);  /* should be &z */

  printf("z=%d\n",z);

  printf("enter value for w:");
  scanf("%d",w);  /* should be &w */

  printf("w=%d\n",w);


  return 0;

}









