Advertisement
Guest User

Untitled

a guest
Dec 11th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. int yes(void)
  2. {
  3. char inChar;
  4. int yon;
  5. int flag = 0;
  6.  
  7. while (flag == 0){
  8. inChar = getchar();
  9. clearKeyboard();
  10. if (inChar == 'y' || inChar == 'Y'){
  11. yon = 1;
  12. flag = 1;
  13. }
  14. if (yon == 'n' || yon == 'N'){
  15. yon = 0;
  16. flag = 1;
  17. }
  18. else{
  19. printf("*** INVALID ENTRY *** <Only (Y)es or (N)o are acceptable>: ");
  20. }
  21. }
  22. return yon;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement