simple.c 369 B

12345678910111213141516171819202122
  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 code. pass=%i\n", pass);
  15. }
  16. return 0;
  17. }