Top

Functions

61.

What will be the output?

double var = 8;
    int main()
    {
        int var = 5;
        printf("%d", var);
    }

 

Answer: A

No answer description available for this question.

Enter details here

Answer: D

No answer description available for this question.

Enter details here

63.

Automatic variables are allocated memory in?

Answer: D

No answer description available for this question.

Enter details here

64.

What is the output of this C code?

static int x = 5;
    void main()
    {
        x = 9;
        {
            int x = 4;
        }
        printf("%d", x);
    }

 

Answer: A

No answer description available for this question.

Enter details here

65.

Which of the following function declaration is illegal?

Answer: D

No answer description available for this question.

Enter details here

66.

Automatic variables are allocated space in the form of a:

Answer: A

No answer description available for this question.

Enter details here

67.

What is the output of this C code?

int x = 5;
    void main()
    {
        int x = 3;
        m();
        printf("%d", x);
    }
    void m()
    {
        x = 8;
        n();
    }
    void n()
    {
        printf("%d", x);
    }

 

Answer: A

No answer description available for this question.
 

Enter details here

68.

The output of the code below is

int *m();
    void main()
    {
        int *k = m();
        printf("hello ");
        printf("%d", k[0]);
    }
    int *m()
    {
        int a[2] = {5, 8};
        return a;
    }

 

Answer: C

No answer description available for this question.

Enter details here

69.

What is the output of this C code?

int main()
{
void foo();
void f()
{
foo();
}
f();
}
void foo()
{
printf("2 ");
}

 

Answer: D

Even though the answer is 2, this code will compile fine only with gcc. GNU C supports nesting of functions in C as a language extension where as standard C compiler doesn’t.

Enter details here

70.

What will be the data type returned for the following function?

int func()
    {
        return (double)(char)5.0;
    }

 

Answer: B

No answer description available for this question.

Enter details here

Loading…
Tags: Functions Questions and Answers || Functions MCQ Questions and Answers || Functions GK Questions and Answers || Functions GK MCQ Questions || Functions Multiple Choice Questions and Answers || Functions GK || GK on Functions || C Programming Questions and Answers || C Programming MCQ Questions and Answers || C Programming GK Questions and Answers || GK on C Programming