how do i generate a random number
and then use this generated number to compare it with a number a user enters.

How can i use [y]es and [n]o . For example a user enter y and then in the
program I want to insert an if and else statement
how can i use if and else to guide the program to do certain things. Please
email me.