Skip to content
Permalink
f53349168d
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
22 lines (20 sloc) 466 Bytes
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <time.h>
int main(void)
{
char* actualPw = "swordfish"; //Of course
char guess[20];
printf ("Enter the password: ");
fgets ( guess, 80, stdin );
//Strip the \n, replace with 0
guess[strcspn(guess, "\n")] = 0;
printf("You entered [%s]\n",guess);
if(strcmp(guess,actualPw)==0){
printf("Password Correct\n");
}else{
printf("Password Incorrect\n");
}
}