MCQ Bank
What is the purpose of the program given below? if (CGPA>=3.0) cout<<”Give Scholarship”; else cout<<”Sorry you do not qualify for the scholarship”;
- A) Determine if a student qualifies for a scholarship
- B) Calculate the CGPA of a student
- C) Print a student's semester grades
- D) Provide information about university policies
How does a while statement in a loop structure work?
- A) It executes the body only once.
- B) It ignores the condition and executes the body indefinitely.
- C) It checks the condition, then executes the body.
- D) It executes the body and then checks the condition.
What approach does the imperative paradigm uses for the programming process?
- A) Finding an algorithm and expressing it as a sequence of commands
- B) Object-oriented approach
- C) Linear scale development
- D) Functional programming approach
In computer programming, what comes after the "if" keyword in an if-statement?
- A) Else
- B) StatementA
- C) Condition
- D) StatementB
Which one of the following is the traditional approach of programming process?
- A) Functional paradigm
- B) Object oriented paradigm
- C) Imperative Paradigm
- D) Declarative paradigm
In the Java programming language, what is the equivalent term for an "activation" in the context of concurrent processing?
- A) Function
- B) Thread
- C) Task
- D) Operation
Let a list Fred, Alex, Diana ,Byron ,Carol
After sorted first sublist our list would be
- A) Fred, Alex, Diana ,Byron ,Carol
- B) Alex, Fred, Diana ,Byron ,Carol
- C) Alex ,Fred ,Byron, Diana, Carol
- D) Alex, Diana , Fred, Byron ,Carol
What is the role of the semicolon in an assignment statement in most imperative languages?
- A) Marks the end of the program
- B) Initiates a loop
- C) Represents a comment
- D) Separates statements
What does the cyclic pattern of a loop involve?
- A) Checking the condition only at the end of the loop.
- B) Ignoring the condition and executing the body.
- C) Repeatedly checking the condition and executing the body.
- D) Executing the body continuously without interruption.
How many choices are possible when using a single if-else statement?
- A) 4
- B) 3
- C) 1
- D) 2
In background, insertion sort algorithm works on _______ code.
- A) ASCII
- B) UTF-16
- C) ANSI
- D) Hexadecimal
Write a program that prints "Pass" if the CGPA is greater than or equal to 2.0 and "Fail" otherwise.
- A) if (CGPA > 2.0) { cout << "Pass"; } else { cout << "Fail"; }
- B) if (CGPA == 2.0) { cout << "Pass"; } else { cout << "Fail"; }
- C) if (CGPA >= 2.0) { cout << "Pass"; } else { cout << "Fail"; }
- D) if (CGPA < 2.0) { cout << "Pass"; } else { cout << "Fail"; }
The Binary Search Algorithm, what will be the mid value in second level of recursion in the following array.
{45, 77, 89, 90, 94, 99, 100} and key = 99
- A) 89
- B) 90
- C) 99
- D) 94
What would be the next statement?
Def findmax():
Max = first number in the list
Current = second number in the list
While (elements in the list exist)
- A) Max=current
- B) Max=value
- C) Current = next value in the list
- D) If (max<current)
What is a correct expression for finding factorial where f = 1 , i=1;
While (i<=n)?
- A) F=f*n
- B) F=f2n
- C) F=f-n
- D) F=f+n
Which of the following symbol is used to represent Boolean operator for logical AND?
- A) ||
- B) &|
- C) &&
- D) !&
A----------- alters the execution sequence of the program
- A) Control statement
- B) Assignment statement
- C) Modulus
- D) Division
How is the illusion of parallel processing achieved when only one CPU is available?
- A) Each activation is assigned to a separate CPU core
- B) Activations share the time of the single processor
- C) Animations are executed in a sequential manner
- D) Multiprogramming systems are employed
Which one is not a valid data type?
- A) Int
- B) Char
- C) Float
- D) Html
What does the imperative paradigm, also known as the procedural paradigm, represent in the programming process?
- A) Traditional approach to programming
- B) Functional programming approach
- C) Object-oriented approach
- D) Linear scale development