Skip to content

Commit

Permalink
Update sign-in.c
Browse files Browse the repository at this point in the history
  • Loading branch information
ConquerorCletus authored Sep 6, 2023
1 parent 2b7bdb5 commit dfd0add
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions c_programming/log-in/sign-in.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <stdio.h>
#include <string.h>
/**
* main - Get user signed in.
* Return:0
Expand All @@ -24,21 +25,17 @@ int main()
fgets(passphrase, sizeof(passphrase),stdin);
printf("Enter your passphrase again(1):\n");
fgets(pass, sizeof(pass),stdin);


/*To make sure pass phrase are the same.*/ for (a = 0; passphrase[a] != '\0' && pass[a] != '\0'; a++)
{ if (passphrase[a] == pass[a]) { printf("Sign-in successful!!\n"); break; }
else if (passphrase[a] != pass[a])
{
printf("Wrong passphrase!!!\n");
break;
}
else if (name[a] == '\0')/* || pass[a] =='\0' || userName == '\0' || name == '\0')*/
{

/*To make sure pass phrase are the same.*/
if (strcmp(passphrase, pass) == 0)
printf("Sign-in successful!!\n");
else if (strcmp(passphrase, pass) != 0)
printf("Wrong passphrase!!!\n");


if (name == '\0' || userName == '\0')
printf("Empty field noticed!!!\n");
}

}


return (0);
}
Expand Down

0 comments on commit dfd0add

Please sign in to comment.