Random number generator game problem

This is a discussion on Random number generator game problem within the C Programming forums, part of the General Programming Boards category; this is the first part of a program i have to make for a class and i need help with ...

Random number generator game problem

this is the first part of a program i have to make for a class and i need help with the guessing game part.
when i type in a number to guess what number the computer has, it always says that i've guessed the right number
here is the code

variable x is irrelevant to this part as it is to decide which game to go to
variable y is the interger the user guesses
variable randomnumber is the number the computer generates
variable z is to terminate the program after the user has guessed correctly

so the problem is with either 'y' or 'randomnumber'
is it the order the if statements are in?
hmmm