0
I want to code this program like,when user enter the password wrong 3 times user will see that ("your account has been blocked f
#include<stdio.h> //ı couldnt do it please help #include<string.h> int main() { char user[100]; char psw[100]; char ruser[100]="getmedown"; char rpsw[100]="well ok"; int count=0; again: printf("\nEnter your ID and password.\n"); gets(user); gets(psw); if(strcmp(user,ruser)==0 && strcmp(psw,rpsw)==0) { printf("Welcome to your account"); } else{ printf("wrong inputs.."); goto again; count++; if(count==3){ printf("your account has been blocked for 5 min"); } } return 0; }
1 ответ
+ 1
use a loop and a count(variable) to the number of times input failed, then when count get to 3 you terminate and give the account blocked message