C Programming Quiz

Quiz for C (Functions)

Time left: 600 seconds

Q.1 In C, parameters are always ___ ?

Passed by value result
Passed by reference
Passed by value
Non-pointer variables are passed by value and pointers are passed by reference
Q.2 In C, what is the meaning of following function prototype with empty parameter list

#include<stdio.h>
void fun()
{
   /* .... */
}                        


Function can be called with any number of parameters of any types
Function can be called with any number of integer parameters.
Function can be called with one integer parameter
Function can only be called without any parameter
Q.3 Which of the following is not a valid C variable name ?

int number;
float rate;
int $main;
int variable_count;
Q.4 Which keyword is used to give back the value ?

void
return
const
static
Q.5 Choose correct statement about Functions in C Language.

Every Function may no may not return a value
Every Function has a return type
A Function is a group of c statements which can be reused any number of times
All of the above
Q.6 What are the types of functions in C Language ?

Both Library and User Defined
User Defined Functions
None of the above
Library Functions
Q.7 What characters are allowed in a C function name identifier ?

Alphabets, Numbers, %, $, _
Alphabets, Numbers, %
Alphabets, Numbers, Underscore ( _ )
Alphabets, Numbers, dollar $
Q.8 What is a Function ?

Function is a block of code that performs a specific task. It has a name and it is reusable.
Function is a block of statements that perform some specific task.
Function is the fundamental modular unit. A function is usually designed to perform a specific task.
All of the above
Q.9 Determine the output of this code ?

#include<stdio.h>
void main()
{
       int i = abc(10);
       printf("%d", --i);
}
int abc(int i)
{
      return(i++);
}                        


11
9
10
None of the above
Q.10 The default parameter passing mechanism is

call by reference
call by value result
None of these.
call by value
Q.11 Types of function in C language

Both B and D
Library Function
None of the above
User defined function
Q.12 What is the maximum number of statements that can present in a C function ?

#include<stdio.h>
void main()
{
  printf("Hello");
}                    


64
None of the above
128
256
Q.13 Choose a non Library C function below.

printf()
printf()
printf4()
scanf()
Q.14 What will be the value returned by the following function, when it is called with a value 11 ?

#include<stdio.h>
recur(int num()) 
{
  if((2) != 0 )
    return(recur(2) * 10+num% %2)
  else
    return 1;
}                    


1011
Function does not return any value, because it goes into an infinite loop
11
None of these
Q.15 A recursive function is faster than __ loop.

for
None of the above
do while
while

Instructions:-

  1. This Quiz is based on the basic concepts of C.
  2. Each correct answer will carry 2 points.
  3. The time limit for this Quiz is 600 seconds i.e. 10 minutes.
  4. The timer will start immediately after clicking on the start button.
  5. Once an option is selected you cannot select any other, So choose wisely.
  6. Do not refresh the page as it will reset the quiz.
  7. Once the time is up the quiz will automatically get submitted with number of questions responded.
  8. Your total score alongwith your name will be displayed after submission of the Quiz.
  9. Wish you ALL THE BEST. 👍👍

START

Results:-

Hi






Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post