1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char trueuser[] = "oussama",truepass[] = "lama", user[100], pass[100];
do
{
printf("enter the user name:\n");
scanf("%s", user);
printf("enter the password:\n");
scanf("%s", pass);
if(strcmp(user,trueuser) == 0 && strcmp(pass,truepass) == 0)
{
printf("bienvenue mon metre\n");
}
else
{
printf(" wrong user name or password\n");
}
}while(strcmp(user,trueuser) != 0 && strcmp(pass,truepass) != 0);
return 0;
} |
Partager