do_while.c 420 B

1234567891011121314151617
  1. /* do_while.c -- exit condition loop */
  2. #include <stdio.h>
  3. int main(void)
  4. {
  5. const int secret_code = 13;
  6. int code_entered;
  7. do
  8. {
  9. printf("To enter the triskaidekaphobia therapy club,\n");
  10. printf("please enter the secret code number: ");
  11. scanf("%d", &code_entered);
  12. } while (code_entered != secret_code);
  13. printf("Congratulations! You are cured!\n");
  14. return 0;
  15. }