Created
September 5, 2012 14:42
-
-
Save 46bit/3637638 to your computer and use it in GitHub Desktop.
Super Simple C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
// Welcome back to C | |
// Handy to ever explain simple C to a friend | |
int main (int argc, char const *argv[]) { | |
printf("%s\n", "Welcome to Count!"); | |
printf("%s %s %s %s%s\n\n", "Printing from", argv[1], "for", argv[2], "."); | |
int count_from = atoi(argv[1]); | |
int count_for = atoi(argv[2]); | |
int count_max = count_from + count_for; | |
int counter; | |
for (counter = count_from; counter <= count_max; counter++) { | |
output_a_count(counter); | |
} | |
return 0; | |
} | |
int output_a_count (int counter) { | |
printf("%i\n", counter); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment