Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Write a recursive function that prints the numbers 1 to X
- * The function must only have one int input.
- * The function must consist of a single function
- * The function must not use loops
- * The function must not use static or global variables.
- * The function must use printf("%i\n",..) to print the numbers
- * The function must print before the recursion call
- * The function must work in theory for any integer between 1 and 2,147,483,647
- */
- #include <stdio.h>
- void f (int x);
- int main(int argsv, char ** argsc)
- {
- int input = 11;
- printf("Testing an input value of %i\n",input);
- f(input);
- printf("Finished testing an input value of %i\n",input);
- return 0;
- }
- void f(int x)
- {
- //TODO: Implement recursive function
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement