Order PDF of any content from our website with a little minor Fee to donate for hard work. Online MCQs are fully free but PDF books are paid. For details: contact whatsapp +923028700085 Important notes based PDF Books are available in very little price, starting from 500/-PKR; Order Now: contact whatsapp +923028700085

VU Past Papers CS201-Most Importants MCQs on Functions and Basic Programming Constructs in C/C++

Q#1: What are the basic constructs of programming mentioned in the paragraph?
a) Functions
b) Sequence, decision making, and loops
c) Declaration and Definition
d) Tips
Answer: b) Sequence, decision making, and loops

Q#2: According to the paragraph, what is one of the major programming constructs?
a) Loops
b) Functions
c) Declaration
d) Tips
Answer: b) Functions

Q#3: What is the concept of functional design or top-down designing based on?
a) Divide and conquer
b) Decision making
c) Sequence
d) Loops
Answer: a) Divide and conquer

Q#4: In top-down designing, what do we do when breaking up a task into smaller subtasks?
a) Keep refining until the task becomes complex
b) Stop at a reasonable level
c) Use a goto statement
d) Minimize the use of break and continue statements
Answer: b) Stop at a reasonable level

Q#5: According to the paragraph, what is the main programming language discussed?
a) C++
b) Java
c) Python
d) C
Answer: d) C

Q#6: What is the specific function-calling methodology mentioned in the paragraph?
a) Functions are called randomly
b) Functions are invoked through a calling program
c) Functions are called only by main()
d) Functions are called by using a goto statement
Answer: b) Functions are invoked through a calling program

Q#7: What is the purpose of the ‘main()’ function in every C program?
a) It is a placeholder and has no significance
b) It is the main loop of the program
c) It is a function-calling methodology
d) It must start with a name, parentheses, and surrounding braces
Answer: c) It is a function-calling methodology

Q#8: How many categories of functions are mentioned in the paragraph?
a) Three
b) One
c) Two
d) Four
Answer: c) Two

Q#9: What is the return value type of a function that does not return any value?
a) int
b) float
c) void
d) char
Answer: c) void

Q#10: According to the paragraph, what keyword is used to return some value from a function?
a) return-value-type
b) data type
c) keyword
d) return
Answer: d) return

Q#11: What is the function-name in the example given in the paragraph?
a) squareRoot
b) circleArea
c) square
d) main
Answer: c) square

Q#12: What does the argument-list of a function contain?
a) Information passed to the function
b) Declarations and statements
c) Valid data types like int number, double radius
d) Body of the function
Answer: a) Information passed to the function

Q#13: According to the paragraph, what is the default return_value_type if not mentioned for a function?
a) float
b) int
c) void
d) char
Answer: b) int

Q#14: What is the body of the function composed of?
a) Return-value-type
b) Function-name
c) Declarations and statements
d) Argument-list
Answer: c) Declarations and statements

Q#15: What is the primary task of the function according to the paragraph?
a) Declaration
b) Definition
c) Invoking
d) Performed in the body of the function
Answer: d) Performed in the body of the function

Q#16: According to the paragraph, what is the keyword of the ‘C’ language for functions that do not return any value?
a) return
b) void
c) data type
d) function
Answer: b) void

Q#17: How is the structure of a function declared in terms of syntax?
a) function-name return-value-type(argument-list)
b) return-value-type function-name { declarations and statements }
c) argument-list return-value-type function-name { declarations and statements }
d) return-value-type function-name
Answer: b) return-value-type function-name { declarations and statements }

Q#18: According to the paragraph, what does the top-down designing mechanism rely on?
a) Sequence
b) Decision making
c) Loops
d) Divide and conquer
Answer: d) Divide and conquer

Q#19: What does the return statement in a function do?
a) Exits from the program
b) Exits from the function
c) Returns some value to the calling program and exits from the function
d) Minimizes the use of break and continue statements
Answer: c) Returns some value to the calling program and exits from the function

Q#20: What programming language is the recommended reading material based on?
a) Java
b) C++
c) Python
d) C
Answer: b) C++

Contents Copyrights Reserved By T4Tutorials