C Language MCQ’S | Functions

Exercise ::

Functions – Find Output of Program
Functions – General Questions
Functions – Find Output of Program
Functions – Point Out Errors
Functions – Point Out Correct Statements
Functions – True / False Questions
Functions – Yes / No Questions

1.
The keyword used to transfer control from a function back to the calling function is

A. switch
B. goto
C. go back
D. return

 

2.
How many times the program will print “Catalyst” ?

#include<stdio.h>

int main()
{
printf("Catalyst");
main();
return 0;
}

A. Infinite times
B. 32767 times
C. 65535 times
D. Till stack overflows

3.
What will be the output of the program?

#include<stdio.h>
void fun(int*, int*);
int main()
{
int i=5, j=2;
fun(&i, &j);
printf("%d, %d", i, j);
return 0;
}
void fun(int *i, int *j)
{
*i = *i**i;
*j = *j**j;
}

A. 5, 2
B. 10, 4
C. 2, 5
D. 25, 4

4.
What will be the output of the program?

#include<stdio.h>
void fun(int*, int);
int main()
{
    int i=10, j=20;
    fun(&i, j);
    printf("%d, %d", i, j);
    return 0;
}
void fun(int *p, int q)
{
    *p = *p * q;
    q = *p + q;
}

A. 10, 20
B. 200, 220
C. 200, 20
D. 25, 4

5.
What will be the output of the program?

#include<stdio.h>
int i;
int fun();

int main()
{
    while(i)
    {
        fun();
        main();
    }
    printf("Hello\n");
    return 0;
}
int fun()
{
    printf("Hi");
}