Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 28th, 2012  |  syntax: None  |  size: 0.42 KB  |  views: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. /* Chapter, Question 19
  2. Emmet Doyle
  3. 28/2/12
  4. */
  5.  
  6. #include<stdio.h>
  7.  
  8. void counting(void);
  9.  
  10. main()
  11. {
  12.     int i;
  13.     int amount;
  14.    
  15.     printf("How many numbers would you like to print?\n\n");
  16.     scanf("%d", &amount);
  17.    
  18.     printf("\n\n");
  19.    
  20.     for (i=0; i<amount; i++)
  21.         counting();
  22.    
  23. }
  24.  
  25. void counting()
  26. {
  27.     static int num = 1;
  28.    
  29.     printf("%d\n",num);
  30.     num += 1;
  31. }