What is the output of the following program? #include <stdio.h> int funcf (int…

GATE · 2004 · IT

What is the output of the following program?

#include <stdio.h>
int funcf (int x);
int funcg (int y);

main()
{
    int x = 5, y = 10, count;
    for (count = 1; count <= 2; ++count)
    {
        y += funcf(x) + funcg(x);
        printf ("%d ", y);
    }
}

funcf(int x)
{
    int y;
    y = funcg(x);
    return (y);
}

funcg(int x)
{
    static int y = 10;
    y += 1;
    return (y+x);
}

  1. A.

    43 80

  2. B.

    42 74

  3. C.

    33 37

  4. D.

    32 32

Attempted by 84 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…