fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main (void) {
  5. char correct_pass[] = "test";
  6. char typed_pass[10];
  7. do {
  8. printf ("\nTo unlock your last tip, enter the correct password: ");
  9. scanf ("%s", typed_pass);
  10. } while (strcmp(typed_pass, correct_pass));
  11. printf ("\nOK!");
  12. }
  13.  
  14. //https://pt.stackoverflow.com/q/205228/101
Success #stdin #stdout 0s 10320KB
stdin
abc
test
stdout
To unlock your last tip, enter the correct password: 
To unlock your last tip, enter the correct password: 
OK!