stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
CT103 MIDTERM GRADED RECITATION Flashcards | StudBud
Explore
/
CT103 MIDTERM GRADED RECITATION
CT103 MIDTERM GRADED RECITATION
40 terms
·
StudBud Administration
·
8 plays
--
Flashcards
40 cards
F
Practice quiz
P
Host live
L
Questions
40
Answers
1
What will this if-else statement output?
Equal
Low
Error
High
2
Which of the following is NOT an application of C++ programming?
Operating System Development
Game Development
Web Page Styling
Database Management
3
What is the smallest individual unit of a C++ program?
Token
Function
Class
Variable
4
Given y = 5; and x = y + 2;, what will be the value of x?
10
7
5
2
5
What is the primary function of a computer program
To control only the hardware of the computer
To randomly execute instructions
To allow humans to communicate with each other
To provide a detailed set of instructions for the computer to follow
6
What is the output of this for loop?
1 3
1 2 4
1 3 5
1 2 3 4 5
7
What is the correct syntax for an assignment statement?
expression = variable;
variable <- expression;
variable = expression;
variable == expression;
8
Which operator checks if two values are equal?
!=
<
>
==
9
What will be the output of this nested loop?
1 4 9
1 2 3 4 5 6
1 2 2 3 3 4
1 2 2 4 3 6
10
What will be the output of this code?
Not equal
Equal
Error
No output
11
Which of the following best defines debugging?
The process of fixing syntax errors in a program
The process of translating a high-level program into a low-level program
The process of converting machine language to assembly language
The process of finding and correcting errors in a program
12
Identify the output/
HI HI
Hihi
Hi
Hi Hi Hi
13
Which of the following is an example of a logical error?
Forgetting to declare a variable
Writing an incorrect mathematical formula, resulting in a wrong output
Using an invalid programming syntax
Misspelling a command, causing the program not to run
14
Why is Assembly Language considered a low-level language?
It is closer to Machine Language and uses symbolic instructions
It is directly understood by the CPU
It uses English-like syntax
It uses English-like syntax
15
What are the three main components of a for loop?
Start, Stop, Repeat
Begin, Execute, End
Initialization, Condition, Update
Declare, Execute, Check
16
Which of the following operators checks if the left operand is greater than or equal to the right operand?
==
<=
>=
!=
17
In software development, what does ‘bug’ refer to?
A syntax rule in high-level languages
A missing file in the program
A completed part of the program
An error or flaw in the program that affects its functionality
18
What is the role of a compiler in high-level programming languages?
It executes program statements one at a time
It checks for logical errors in the program
It converts machine language into assembly language
It translates high-level code into machine language before execution
19
What does the != operator do?
Checks if the left operand is greater than the right operand
Checks if two values are not equal
Checks if two values are equal
Checks if the left operand is less than or equal to the right operand
20
In a do-while loop, when is the condition checked?
After executing the loop
It is never checked
In the middle of the loop execution
Before executing the loop
21
Which of the following is a valid identifier in C++?
2ndVariable
my-variable
myVariable
class
22
What is the primary purpose of the <iomanip> header file?
To perform mathematical computations
To perform formatted I/O using stream manip like setw and setprecision
To define cin, cout, cerr, and clog
To declare file processing services
23
Which data type is used to store a single character in C++?
float
char
int
double
24
What is the output of this do-while loop?
54321
543
5 4 3 2 1
5 4 3
25
Which header file is responsible for handling standard input and output operations in C++?
<iomanip>
<iostream>
<fstream>
<cmath>
26
Which of the following is NOT a type of operator in C++?
Incremental Operator
Assignment Operator
Arithmetic Operator
Logical Operator
27
What happens during the execution stage of a program?
The program runs and produces results
The program is linked with external libraries
The program is written and edited
The program is compiled into object code
28
What is object code?
The original source code written by the programmer
The final executable file
A debugging tool
The output produced by the compiler.
29
Who developed the C++ programming language?
James Gosling
Dennis Ritchie
Bjarne Stroustrup
Ken Thompson
30
What symbol is used for a single-line comment in C++?
#
--
/* */
//
31
Which of the following is a logical error in a for loop?
Using a relational condition in the condition section
Using a decrement operation in the update section
Using an increment operation in the update section
Placing a semicolon immediately after the for loop header
32
What is the output of the following code?
X is equal to Y
X is greater
No output
X is greater
33
When does the increment portion of a for loop execute?
It executes only if the condition is false
At the start of the loop
Before the first iteration
After the first iteration
34
Why is C++ considered a middle-level language?
Because it is used only for application development
Because it supports object-oriented programming only
Because it is compiled and case-sensitive
Because it combines both high-level and low-level language features
35
What does this program print?
1 3
1 3 5
1 2 3
Infinite loop
36
What is the correct syntax for declaring a variable in C++?
identifier datatype;
datatype identifier;
variable datatype;
declare identifier;
37
What is the purpose of a semicolon ( ; ) in a C++ program?
To separate items in a list
To define a variable
To end a statement
To indicate a comment
38
What is the output of the following code?
3 4 5 6
Infinite loop
3 4 5
3 4
39
What will be the final value of 'sum' in this code?
4
10
6
15
40
What is the main purpose of an interpreter in programming?
To check for logical errors before execution
To optimize a program for better performance
To convert a high-level language into machine code all at once
To translate and execute program statements one at a time