Consider the following C code segment.
int a, b, c = 0;
void prtFun (void);
main ()
{
static int a = 1; /* Line 1*
prtFun ();
a + = 1;
prtFun ();
pringf(“\n %d %d ”, a, b);
}
Void prtFun (void)
{
static int a = 2; /* Line 2 */
int b = 1;
a + = + + b;
printf (“ \n %d %d ”, a, b);
}
What output will be generated by the given code segment? 2012 MCQ || 2-mark
3 1
4 1
4 2
4 2
6 1
6 1
4 2
6 2
2 0
3 1
5 2
5 2
This question is part of this quiz :
GATE|| C Programming & Data Structure || Pyqs (2010 to 2025 ),GATE || C Programming || PYQS (2010 to 2025)