8 8 votes #include <stdio.h> void fun() { static int count = 0; count++; printf("%d ", count); } int main() { for (int i = 0; i < 3; i++) fun(); return 0; } What is the output of the above C program?$111$ $012$ $123$ $321$ Programming in C goclasses c-programming goclasses-cs-dpp goclasses-cs-dpp-day-56 goclasses-c-programming-practice-questions + – GO Classes 960 views answer comment Share Follow Print See 1 comment 1 1 comment reply petals90 commented Jul 25, 2025 reply Follow flag Option C. Static is initialised just once and it's earlier values are used for further evaluation. 2 2 replyShare Please log in or register to add a comment.
1 1 vote The variable count is declared as static, so it retains its value between function calls. Each time fun() is called, count increases by 1 and prints its value.so, Ans- c. 123 i_m_sudip answered Jul 26, 2025 i_m_sudip comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes The correct answer is Option C) 123the static variables are initialised once, and they have lifetime during the program. Umesh Shelke answered Aug 22, 2025 Umesh Shelke comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes Option c) 123 Muppuri_Malyadri answered Oct 28, 2025 Muppuri_Malyadri comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes C. option 123 SERAPHINA answered Mar 3 SERAPHINA comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes Option C 320126511129_GULLAHA answered Mar 3 320126511129_GULLAHA comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes c binaryXninja answered Mar 31 binaryXninja comment Share Follow 0 reply Please log in or register to add a comment.