I want to write a C function that will print 1 to N one per each line on the stdout where N is a int parameter to the function. The function should not use while, for, do-while
This does it:
int main () { printf ("1 to N one per each line\n"); return 0; }
Here is another one:
#include #include int main (int c, char ** v) { char b[100]; sprintf (b, "perl -e 'map {print \"$_\\n\"} (1..%s)'", v[1]); system (b); return 0; }