Advertisement
Guest User

blah

a guest
Dec 19th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void doit() {
  5.     printf("Hello World\n");
  6. }
  7.  
  8. int goAgain() {
  9.     char ch;
  10.    
  11.     printf("Again? (Y/N): ");
  12.     scanf(" %c", &ch);
  13.     return (ch=='Y' || ch=='y');
  14. }
  15.  
  16. int main() {
  17.     for(;;)/> { /* infinite loop */
  18.         doit();
  19.         if (!goAgain()) { break; }
  20.     }
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement