C MCQ Questions and Answers on Functions and Pointers 2

Image

Study C MCQ Questions and Answers on Functions and Pointers. Questions are on Recursion, Pass by Value and Pass By Reference. Attend C technical interviews easily after reading these Multiple Choice Questions.

Go through C Theory Notes on Functions before reading questions.



1) What is the limit for number of functions in a C Program.?
A) 16
B) 31
C) 32
D) None of the above
Answer [=]
Answer[=]
2) Every C Program should contain which function.?
A) printf()
B) show()
C) scanf()
D) main()
Answer [=]
Answer[=]
3) What is the minimum number of functions to be present in a C Program.?
A) 1
B) 2
C) 3
D) 4
Answer [=]
Answer[=]
4) What is the output of C Program with functions.?
static void show();

int main()
{
    printf("ROCKET ");
    show();
    return 0;
}

static void show()
{
    printf("STATIC");
}
A) ROCKET
B) ROCKET STATIC
C) STATIC ROCKET
D) Compiler error
Answer [=]
Answer[=]
5) What is the maximum number of statements that can present in a C function.?
A) 64
B) 128
C) 256
D) None of the above
Answer [=]
Answer[=]
6) What characters are allowed in a C function name identifier.?
A) Alphabets, Numbers, %, $, _
B) Alphabets, Numbers, Underscore ( _ )
C) Alphabets, Numbers, dollar $
D) Alphabets, Numbers, %
Answer [=]
Answer[=]
7) What is the output of C Program with functions and pointers.?
int main()
{
    int b=25;
    //b memory location=1234;
    int *p = b;
    printf("%d %d", b, p);

    return 0;
}
A) 25 1234
B) 25 0
C) 25 25
D) Compiler error
Answer [=]
Answer[=]


 

8) What is the output of C Program with functions and pointers.?
int main()
{
    int b=25;
    //b memory location=1234;
    int *p;
    p=&b;
    printf("%d %d %d", &b, p);
    return 0;
}
A) 25 25
B) 1234 1234
C) 25 1234
D) 1234 25
Answer [=]
Answer[=]
9) What do you call STAR * and Ampersand & in a c program context.?
int a=10, *p;
p = &a;
printf("%d %d", a, *p);
A) * = ADDRESS OF operator, & = VALUE AT operator
B) * = ADDRESS OF operator, & = ADDRESS OF operator
C) * = VALUE AT operator, & = ADDRESS OF operator
D) * = VALUE AT operator, & = VALUE AT operator
Answer [=]
Answer[=]
10) What is the output of C Program with functions.?
#include 
int sum(int,int);
int main()
{
    int a=5, b=10, mysum;
    mysum = sum(a,b);
    printf("SUM=%d ", mysum);
    printf("SUM=%d", sum(10,20));
    return 0;
}
int sum(int i, int j)
{
    return (i+j);
}
A) SUM=15 SUM=30
B) SUM=30 SUM=15
C) SUM=15 SUM=15
D) SUM=30 SUM=30
Answer [=]
Answer[=]
11) Arguments passed to a function in C language are called ___ arguments.
A) Formal arguments
B) Actual Arguments
C) Definite Arguments
D) Ideal Arguments
Answer [=]
Answer[=]
12) Arguments received by a function in C language are called ___ arguments.
A) Definite arguments
B) Formal arguments
C) Actual arguments
D) Ideal arguments
Answer [=]
Answer[=]
13) Choose a corrects statement about C language function arguments.
A) Number of arguments should be same when sending and receiving
B) Type of each argument should match exactly 
C) Order of each argument should be same
D) All the above
Answer [=]
Answer[=]
14) What is the output of C program with functions.?
int main()
{
    printf("funny=%d" , funny());
    return 0;
}
funny()
{
   
}
A) funny=
B) funny=1
C) funny=0
D) Compiler error
Answer [=]
Answer[=]


 

15) What is the output of C Program with functions.?
void funny2();
int main()
{
    printf("funny2=%d" , funny2());
    return 0;
}
void funny2()
{

}
A) funny2=
B) funny2=0
C) funny2=1
D) Compiler error
Answer [=]
Answer[=]
16) Choose a correct statement with C Functions.
A) A function can call any other function any number of times
B) You can write any function in any order in a multi function C File.
C) You can refer to or call any function using a Pointer also.
D) All the above
Answer [=]
Answer[=]
17) Choose a non Library C function below.
A) printf()
B) scanf()
C) fprintf()
D) printf2()
Answer [=]
Answer[=]
18) What is the default return value of a C function if not specified explicitly.?
A) -1
B) 0
C) 1
D) None of the above
Answer [=]
Answer[=]
19) What do you call this C Function calling itself.?
int funny2()
{
    funny2(num);
}
A) Indefinite Function
B) Definite Function
C) Cursive Function
D) Recursive Function
Answer [=]
Answer[=]
20) What is the output of C Program with functions.?
int bunny(int,int);
int main()
{
    int a, b;
    a = bunny(5, 10);
    b = bunny(10, 5);
    printf("%d %d", a, b);
    return 0;
}
int bunny(int i, int j)
{
    return (i, j);
}
A) 5 10
B) 10 5
C) 5 5
D) Compiler error
Answer [=]
Answer[=]


Like or Share

Show some care. Like or Subscribe. [FB]...[Youtube]

C MCQ App by ExamTray 

Android APP

Java MCQ App by ExamTray 

Android APP
ALL MCQ App by ExamTray Android APP

Ad

 

Some good C Books

Book Price
1. C: The Complete Reference  Check Price
2. Let Us C Check Price
3. Programming in ANSI C Check Price
4. The C Programming Language Check Price

We may get some affiliate commission for the above purchases.