simple.c 404 B

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