Advertisement
bobbinz

Count Up

Oct 14th, 2011
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. //A simple program to count up to a set number, or set series of numbers.
  2.  
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5.  
  6. char input[256];
  7. int converted_input;
  8. int count = 1;
  9.  
  10. int main()
  11. {
  12.     printf("\nWhat number would you like to count to? ");
  13.     scanf("%s",input);
  14.     converted_input = atoi(input);
  15.     printf("\n");
  16.     for (count = 1; count !=  converted_input + 1 ; count++)
  17.     {
  18.         printf("%i\t",count);
  19.     }
  20.     printf("\n");
  21.     main();
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement