I am making Bubble game in c where randomly some numbers are generating on the console window and user need to enter that numbers appearing on the screen or console window and I need to compare that user input and random generated number and make that number invisible from the screen.
I have used rand() function in c and for user input I have used getch() function and i have tried every type conversion but not getting the solution yet.
void main() {
char temp1 = 0;
char temp = 0;
temp1 = rand()%10;
temp = getch();
if(temp == temp1)
printf("ok");
}
I want to compare randomly generated value and user input at run time and input given by the user by seeing on console's number is equal i want to exit.