Top

Functions

41.

What is the output of the following program?

#include

void swap(int m, int n)
{
   int x = m;
   
   m = n;
   n = x;
}
main()
{
   int x=5, y=3;

   swap(x,y);
   printf("%d %d", x, y);
}

 

Answer: B

5 3, call by value mechanism can’t alter actual arguments.

Enter details here

42.

The variable declaration with no storage class specified is by default:

Answer: A

No answer description available for this question.
 

Enter details here

43.

functions can return structure in c?

Answer: A

No answer description available for this question.

Enter details here

44.

Is it true that too many recursive calls may result into stack overflow?

Answer: A

Yes, too many recursive calls may result into stack overflow. because when a function is called its return address is stored in stack.

After sometime the stack memory will be filled completely. Hence stack overflow error will occur.

Enter details here

45.

What is the output of this C code?

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

 

Answer: D

No answer description available for this question.

Enter details here

46.

 

What is the output of this C code?

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

 

Answer: A

No answer description available for this question.
 

Enter details here

47.

The output of the code below is

void m(int k)
    {
        printf("hi");
    }
    void m(double k)
    {
        printf("hello");
    }
    void main()
    {
        m(3);
    }

 

Answer: C

No answer description available for this question.

Enter details here

48.

Default storage class if not any is specified for a local variable, is auto:

Answer: A

No answer description available for this question.

Enter details here

Answer: B

No answer description available for this question.

Enter details here

50.

A function may have any number of return statements each returning different values.

Answer: A

True, A function may have any number of return statements each returning different values and each return statements will not occur successively.

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