Hi. Below is my program. I had to do one question with functions in my program, however, when i typed it out, i checked for errors but there were none. But only 3 warning messages, it says

'possible use of 'x', 'y', and 'z' before definition in function main'

Ok, then, so i ignored that, hoping it would work anyways, the program runs, and when i type in my first integer and hit [enter] key, it gives me a critical error, something saying bout general protection processor fault (something like that). Could anyone help me out here, just by pointing out my mistakes in my program below, and give suggestions what i can do to fix it. Thx!

#include<stdio.h>

int add(int, int);

int subtract(int, int);

int multiply(int, int);

int divide(int, int);

float result = 0;

main()

{

int x, y;

char z;

printf("Please enter first integer: ");

scanf("%d", x);

printf("Now enter another integer: ");

scanf("%d", y);

printf("Now which operation would you like to perform with two integers?\n");

printf("Press 'a' for addition\nPress 's' for substraction");

printf("Press 'm' for multiplication\nPress 'd' for division");

scanf("%c", z);

switch (z){

case 'a': case 'A':

add(x, y);

printf("Addition: %d + %d = %f.2", x, y, add(x, y));

break;

case 's': case 'S':

subtract(x , y);

printf("Subtraction: %d + %d = %.2f", x, y, subtract(x, y));

break;

case 'm': case 'M':

multiply(x, y);

printf("Multiplication: %d + %d = %.2f", x, y, multiply(x, y));

break;

case 'd': case 'D':

divide(x, y);

printf("Division: %d + %d = %.2f", x, y, divide(x, y));

break;

default:

printf("I'm sorry, the key you typed in was not in operation menu.\n Please try again!");

}

return 0;

}

int add( int a, int b){

result = a + b;

return result;

}

int subtract(int a, int b){

result = a - b;

return result;

}

int multiply(int a, int b){

result = a * b;

return result;

}

int divide(int a, int b){

result = a / b;

return result;

}