šŸŽ“ Flashcard Mode

Programming in C

Card1 / 5
Mastered0
Review0
QuestionClick to flip

Find out the output of the given program or error if any.

static int i=10;
int main()
{     
i=25;       // line 4     
printf(%d,i);     
return 0;
}

AnswerClick to flip back
A
25
šŸ’” Explanation:

This is the correct option because the scope of static variable is throughout the program, hence the assignment at line 4 changes the value of static variable to 25. So this is the correct answer.

Change Mode