Vidyalelo
C Programming · all questions

Function
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

223

Questions

2/12

Page

Pick an option on a question to see the right answer and solution.

In C, what is the purpose of the 'inline' keyword when used with a function?

Select an option to see the answer and solution.

What is a function parameter in C?

Select an option to see the answer and solution.

What is the result of the expression ceil(3.2) in C, assuming proper inclusion of the math library?

Select an option to see the answer and solution.

In C, what is the purpose of the 'const' keyword when used with a function parameter?

Select an option to see the answer and solution.

How can you declare a function in C that takes a variable number of arguments?

Select an option to see the answer and solution.

In C, what is the purpose of the 'recursion' in a function?

Select an option to see the answer and solution.

What is the result of the expression pow(2, 3) in C, assuming proper inclusion of the math library?

Select an option to see the answer and solution.

What is the purpose of the 'volatile' keyword when used with a function in C?

Select an option to see the answer and solution.

What is the result of the expression abs(-7.5) in C?

Select an option to see the answer and solution.

In C, what is a function parameter's scope?

Select an option to see the answer and solution.

What will happen after compiling and running following code?
main()
{ 
     printf("%p", main); 
}

Select an option to see the answer and solution.

Use of functions

Select an option to see the answer and solution.

Any C program

Select an option to see the answer and solution.

What is function?

Select an option to see the answer and solution.

Determine output:
main()
{
      int i = abc(10);
      printf("%d", --i);
}

int abc(int i)
{
      return(i++);
}

Select an option to see the answer and solution.

The default parameter passing mechanism is

Select an option to see the answer and solution.

What is the result of compiling and running this code?
main()
{
      char string[] = "Hello World";
      display(string);
}

void display(char *string)
{
      printf("%s", string);
}

Select an option to see the answer and solution.

Determine output:
main()
{
      int i = 5;
      printf("%d%d%d%d%d", i++, i--, ++i, --i, i);
}

Select an option to see the answer and solution.

Pick the correct statements.
I.   The body of a function should have only one return statement.
II.  The body of a function may have many return statements.
III. A function can return only one value to the calling environment.
IV. If return statement is omitted, then the function does its job but returns no value to the calling environment.

Select an option to see the answer and solution.

What will be the output of the following program code?
main()
{
      static int var = 5;
      printf("%d ", var--);
      if(var)
            main();
}

Select an option to see the answer and solution.