login and sign in prototype using c programming language
#include<stdio.h>
#include<string.h>
int main()
{
char userId[50];
char password[50];
char userId2[50];
char password2[50];
printf("\033[1;34mSign Up\033[0m\n");
printf("set your name:");
scanf("%s", &userId);
printf("Set password:");
scanf("%s", &password);
printf("\033[H\033[J");
printf("_______________________");
sleep(1);
printf("________________\n");
while(1)
{ printf("\033[1;35mLogin : \033[0m\n");
printf("Enter User Id:");
scanf("%s", &userId2);
printf("Enter password:");
scanf("%s", &password2);
if(strcmp(userId,userId2)==0)
{
if(strcmp(password,password2)==0)
{
printf("\033[1;92mAccess granted.");
break;
}
else
{printf("\033[1;31mwrong password.");
continue;
}
}
else
printf("\033[1;31mwrong user Id.\n");
continue;
}
return 0;
}
Comments
Post a Comment