Q. What is the output of the program.?

Code:
void myshow();

int main()
{
	myshow();
	myshow();
	myshow();
}

void myshow()
{
	static int k = 20;
	printf("%d ", k);
	k++;
}
  • (A) 20 20 20
  • (B) 20 21 21
  • (C) 20 21 22
  • (D) Compiler error.
πŸ’¬ Discuss
βœ… Correct Answer: (C) 20 21 22

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
282
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
97%
Success Rate