Consider this corrected C program (with the function call sequenced before the…

PYQ UGC NET 2006Modified — slightly modified from the official paper; see the solution

Consider this corrected C program (with the function call sequenced before the array assignment): int arr[]={1, 2, 3, 4}; int count; int incr(void) { return ++count; } int main(void) { int value = incr(); arr[count++] = value; printf("arr[count]=%d\n", arr[count]); } The value printed by the program is:

  1. A.

    1

  2. B.

    2

  3. C.

    3

  4. D.

    4

Attempted by 26 students.

Sign up free to check your answer

Sign up free

Explore the full course: Nta Ugc Net Paper 2

Loading lesson…