#include #include #include void main() { int i=0,key=0,trys=1; char temp,a[7],b[7]={'1','2','3','4','5','6','7'}; again: if(trys<=3) { printf("\nwelcome to 'c' language \nby 'www.computersciencearticle.in'"); printf("\n\nEnter the password="); while(i<20) { temp=getch(); if (temp==13) break; a[i]=temp; i++; printf("*"); } for(i=0;i<7;i++) { if(a[i]!=b[i] || a[i]==NULL) key=1; } } else { printf("You tries maximum times"); exit(0); } if(key==0) printf("\n\n\n\t\t\t\tYou Entered correct password"); else { printf("\n\n\n\tYou have entered a wrong password. \nYou have tried %d out of 3 ",trys); trys++; goto again; } getch(); }