Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132934 views
License: OTHER
1
#include <stdio.h>
2
3
int main(void) {
4
char buff[10];
5
int pass = 0;
6
7
printf("Enter password: ");
8
gets(buff);
9
10
if (strcmp(buff, "correct")) {
11
printf("Wrong Password\n");
12
} else {
13
printf("Correct Password\n");
14
pass = 1;
15
}
16
17
if (pass) {
18
printf("Password protected");
19
printf(" code. pass=%i\n",
20
pass);
21
}
22
23
return 0;
24
}
25