Hey guys,
I am new to the forums and pretty average at c programming at the moment, but there is this one program that i just cant get to run and it is annoying the hell out of me. please help, any advice is greatly appreciated
Basically i am trying to get it to ask you to guess password and if you get it wrong it says try again, and if you get it right the program ends. I would like to add 3 choices to it as i learn more. i know this is the simplest program but I am determined to get it working, thanks
Code:#include <stdio.h> #include <stdlib.h> int main() { int pass; int guess; pass = 123; printf("Try and Guess My Password\n"); printf("Password: %d ", guess); scanf("%d", guess); if (guess != pass) { printf("incorrect try again"); } else { printf("You guessed it"); } return 0; }