adplus-dvertising

Welcome to the Functions MCQs Page

Dive deep into the fascinating world of Functions with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Functions, a crucial aspect of C Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Functions, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within C Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Functions. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of C Programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Functions. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Functions MCQs | Page 30 of 39

Q291.
Which of the following is/are syntactically correct?
Discuss
Answer: (d).for ( ; ; ) ;
Discuss
Answer: (d).both (a) and (b)
Q293.
Following is a recursive function for computing the sum of integers from 0 to N. The missing line in the else part is
function sum(N:integer):integer
begin
if N=0 then Sum=0
else
end;
Discuss
Answer: (b).Sum:=N+Sum(N-1)
Q294.
Which of the following is not a primitive recursive but partially recursive?
Discuss
Answer: (d).Ackermann's function
Q295.
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. 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.
Discuss
Answer: (c).II and III
Discuss
Answer: (b).Function can be called with any number of parameters of any types
Q297.
Which of the following statements are correct about the given program?
#include <stdio.h>
int main()
{
    printf("%p", main());
    return 0;
}
Discuss
Answer: (c).Runs infinite times without printing anything
Q298.
What is the output of this program?
#include <stdio.h>
void fun(int a, ...)
{
    printf("%d ", a);
}
 
int main()
{
    fun(1,2,3,4);
    fun(5,6,7,8,9);
    return 0;
}
Discuss
Answer: (a).1 5
Discuss
Answer: (a).Access to static functions is restricted to the file where they are declared
Q300.
What is the output of this program?
#include <stdio.h>
int demo()
{
  static int i = 0;  
  printf("%d ",i++);
}
int main()
{
  for(int j = 0 ; j < 5 ; j++ )
  {
      demo();
  }
}
Discuss
Answer: (d).0 1 2 3 4

Suggested Topics

Are you eager to expand your knowledge beyond C Programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!