Q. What is the output of C program?

Code:
int fun()
{
  static int num = 16;
  return num--;
}
 
int main()
{
  for(fun(); fun(); fun())
    printf("%d ", fun());
  return 0;
}
  • (A) Infinite loop
  • (B) 13 10 7 4 1
  • (C) 15 12 8 5 2
  • (D) 14 11 8 5 2
πŸ’¬ Discuss
βœ… Correct Answer: (D) 14 11 8 5 2

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
228
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
87%
Success Rate