Hi, I'm pretty new to C and (once again) I have a problem with a 'piece' of code...
The program asks the user for his password(12345), and if the user types the wrong password, the program keeps asking. The program runs on my compiler, but everything I type is wrong, what's wrong?Code:#include <stdio.h>
void main()
{
int x;
printf("Type your password\n");
scanf("%d", x);
while (x!=12345){
printf("Wrong, type your correct password\n");
scanf("%d", x);
if (x==12345)
printf("Right password\n");
}
}
Thanks