A

Admin • 833K Points
Coach

Q. How many times will 'Hello' be printed?

Code:
void print(int n) {
if (n == 0) return;
printf("Hello
");
print(n-1);
}
int main() { print(5); }
  • (A) 4
  • (B) 5
  • (C) 6
  • (D) Infinite
  • Correct Answer - Option(B)
  • Views: 26
  • Filed under category C Programming
  • Hashtags:

Explanation by: Admin

Function prints 'Hello' 5 times before reaching base condition.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.