C MCQ Questions and Answers on Functions and Pointers 1

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) Choose correct statement about Functions in C Language.
A) A Function is a group of c statements which can be reused any number of times.
B) Every Function has a return type.
C) Every Function may no may not return a value.
D) All the above.
Answer [=]
Answer[=]
2) Choose a correct statement about C Language Functions.
A) A function name can not be same as a predefined C Keyword.
B) A function name can start with an Underscore( _ ) or A to Z or a to z.
C) Default return type of any function is an Integer.
D) All the above.
Answer [=]
Answer[=]
3) Choose a correct statement about C Function.?
main()
{
    printf("Hello");
}
A) "main" is the name of default must and should Function.
B) main() is same as int main()
C) By default, return 0 is added as the last statement of a function without specific return type.
D) All the above
Answer [=]
Answer[=]
4) A function which calls itself is called a ___ function.
A) Self Function
B) Auto Function
C) Recursive Function
D) Static Function
Answer [=]
Answer[=]
5) What is the output of C Program with Functions.?
int main()
{

    void show()
    {
        printf("HIDE");
    }

    show();
    
    return 0;
}
A) No output
B) HIDE
C) Compiler error
D) None of the above
Answer [=]
Answer[=]
6) What is the output of C Program with functions.?
void show();

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

void show()
{
    printf("AFRICA ");
}
A) ARGENTINA AFRICA
B) AFRICA ARGENTINA
C) ARGENTINA
D) Compiler error
Answer [=]
Answer[=]
7) What is the output of C Program with functions.?
int main()
{
    show();
    printf("BANK ");
    return 0;
}

void show()
{
    printf("CURRENCY ");
}
A) CURRENCY BANK
B) BANK CURRENCY
C) BANK
D) Compiler error
Answer [=]
Answer[=]


 

8) How many values can a C Function return at a time.?
A) Only One Value
B) Maximum of two values
C) Maximum of three values
D) Maximum of 8 values
Answer [=]
Answer[=]
9) What is the output of a C program with functions.?
void show();

void main()
{
    show();
    printf("RAINBOW ");
    
    return;
}

void show()
{
    printf("COLOURS ");
}
A) RAINBOW COLOURS
B) COLOURS RAINBOW
C) COLOURS
D) Compiler error
Answer [=]
Answer[=]
10) What is the output of C Program.?
void show();

void main()
{
    printf("PISTA ");
    show();
}

void show()
{
    printf("CACHEW ");
    return 10;
}
A) PISTA CACHEW
B) CASHEW PISTA
C) PISTA CASHEW with compiler warning
D) Compiler error
Answer [=]
Answer[=]
11) What is the output of C Program with functions.?
int show();

void main()
{
    int a;
    printf("PISTA COUNT=");
    a=show();
    printf("%d", a);
}

int show()
{
    return 10;
}
A) PISTA COUNT=
B) PISTA COUNT=0
C) PISTA COUNT=10
D) Compiler error
Answer [=]
Answer[=]
12) What is the output of C Program with functions.?
void main()
{
    int a;
    printf("TIGER COUNT=");
    a=show();
    printf("%d", a);
}

int show()
{
    return 15;
    return 35;
}
A) TIGER COUNT=15
B) TIGER COUNT=35
C) TIGER COUNT=0
D) Compiler error
Answer [=]
Answer[=]
13) What are types of Functions in C Language.?
A) Library Functions
B) User Defined Functions
C) Both Library and User Defined
D) None of the above
Answer [=]
Answer[=]
14) What is the output of C program with functions.?
int show();

void main()
{
    int a;
    a=show();
    printf("%d", a);
}

int show()
{
    return 15.5;
    return 35;
}
A) 15.5
B) 15
C) 0
D) Compiler error
Answer [=]
Answer[=]


 

15) What is the output of C Program.?
int myshow(int);

void main()
{
   myshow(5);
   myshow(10);
}

int myshow(int b)
{
    printf("Received %d, ", b);
}
A) Received 5, Received 10,
B) Received 10, Received 5,
C) Received 0, Received 0,
D) Compiler error
Answer [=]
Answer[=]
16) What is the output of C Program with functions and pointers.?
int myshow(int);

void main()
{
   int a=10;
   myshow(a);
   myshow(&a);
}

int myshow(int b)
{
    printf("Received %d, ", b);
}
A) Received 10, Received 10,
B) Received 10, Received RANDOMNumber,
C) Received 10, Received RANDOMNumber, with a compiler warning
D) Compiler error
Answer [=]
Answer[=]
17) What is the output of C Program with functions and pointers.?
int myshow(int *);

void main()
{
   int a=10;
   myshow(&a);
}

int myshow(int *k)
{
    printf("Received %d, ", *k);
}
A) Received RANDOMNumber,
B) Received 10,
C) Received 10,
D) Compiler error
Answer [=]
Answer[=]
18) What is the output of C Program with functions and pointers.?
void myshow(int *);

void main()
{
   int a=10;
   printf("%d ", a);
   myshow(&a);
   printf("%d", a);
   
}

void myshow(int *k)
{
   *k=20;
}
A) 10 10
B) 20 20
C) 10 20
D) Compiler error
Answer [=]
Answer[=]
19) What is the output of C Program with functions.?
void myshow(int);

void main()
{
   int a=10;
   printf("%d ", a);
   myshow(a);
   printf("%d", a);
   
}

void myshow(int k)
{
   k=20;
}
A) 10 10
B) 20 20
C) 10 20
D) Compiler error
Answer [=]
Answer[=]
20) Choose correct statements about C Language Pass By Value.
A) Pass By Value copies the variable value in one more memory location.
B) Pass By Value does not use Pointers.
C) Pass By Value protects your source or original variables from changes in outside functions or called functions.
D) All the above
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.