+ 1
Define a recursive print function that prints numbers from n to 0
void print(int n) { if (n < 0) return; printf("%d", n); (n - 1); }
2 Answers
- 2
void print(int n) {
if (n< 0) return;
printf ("%d", n);
print (n-1);
}
- 6
Your question is, why it does not work, yes?
"(n - 1);" has to be "print(n - 1)"