computer MCQs

10th • Chapter 01

50 Questions TextBook
1

A software that provides a complete environment to facilitate programmers in writing and executing programs is known as an

A
Editor
B
Compiler
C
Integrated Development Environment (IDE)
D
Debugger
2

Who is credited with the development of the C language?

A
Steve Jobs
B
Bill Gates
C
Dennis Ritchie
D
James Gosling
3

The process of converting a high-level language program into machine language is called

A
Execution
B
Compilation
C
Debugging
D
Editing
4

Which of the following is a fundamental component of an IDE that allows writing and editing code?

A
Text Editor
B
Debugger
C
Linker
D
Loader
5

Words that have a predefined meaning in C and cannot be used as variable names are called

A
Constants
B
Variables
C
Reserved Words
D
Comments
6

Which of the following is a valid reserved word in C?

A
main
B
string
C
program
D
float
7

The main part of a C program where the execution begins is the

A
#include section
B
comment section
C
main() function
D
variable declaration section
8

What symbol is used to terminate a statement in C?

A
Colon (:)
B
Period (.)
C
Semicolon (;)
D
Comma (,)
9

How is a single-line comment denoted in C?

A
/* comment */
B
// comment
C
<!-- comment -->
D
# comment
10

Which of the following correctly represents a multi-line comment in C?

A
// comment //
B
/* comment */
C
## comment ##
D
comment
11

Values that do not change during the execution of a program are known as

A
Variables
B
Data Types
C
Functions
D
Constants
12

Which of the following is an example of an integer constant?

A
-54
B
75.0
C
A
D
3.14
13

A value like 3.14 or -1575.76 is a type of

A
Integer Constant
B
Character Constant
C
Real Constant
D
String Constant
14

A name given to a memory location to store data that can be changed is called a

A
Constant
B
Variable
C
Keyword
D
Header
15

Which data type is used to store whole numbers in C?

A
float
B
char
C
int
D
double
16

How many bytes of memory does a standard `float` data type typically occupy?

A
1 byte
B
2 bytes
C
4 bytes
D
8 bytes
17

Which data type is most suitable for storing a single character like 'S'?

A
int
B
float
C
string
D
char
18

According to the rules for naming variables in C, which of the following is an invalid variable name?

A
_myVar
B
total_Sum
C
1stPlace
D
averageWeight
19

A variable name in C must begin with a

A
Digit
B
Special symbol like $
C
Letter or an underscore
D
Number
20

The process of assigning a value to a variable for the first time is called

A
Declaration
B
Initialization
C
Compilation
D
Execution
21

Which section of a C program includes files like `stdio.h`?

A
Main section
B
Body of main
C
Link section
D
Comment section
22

The `printf()` function is predefined in which header file?

A
math.h
B
conio.h
C
string.h
D
stdio.h
23

The body of the `main()` function is enclosed within which symbols?

A
Parentheses ()
B
Square Brackets []
C
Angle Brackets <>
D
Curly Braces {}
24

The property of C language where `int` is different from `Int` is known as

A
Case Insensitive
B
Case Sensitive
C
Syntax Error
D
Logical Error
25

What is the purpose of a debugger in an IDE?

A
To write code
B
To find and fix errors
C
To convert code to machine language
D
To design the user interface
26

Java, C++, and Python are examples of

A
Operating Systems
B
Programming Languages
C
Hardware
D
Web Browsers
27

What kind of error is generated if the rules or grammar of the programming language are not followed?

A
Runtime Error
B
Logical Error
C
Syntax Error
D
Hardware Error
28

Which keyword is used to declare a variable that can store values like 23.5?

A
int
B
char
C
float
D
real
29

An `unsigned int` data type can store

A
Only positive values
B
Only negative values
C
Both positive and negative values
D
Only zero
30

How many digits of precision can a `float` data type store?

A
Up to 2
B
Up to 4
C
Up to 6
D
Up to 8
31

A unique name given to a variable is also known as its

A
Constant
B
Data type
C
Identifier
D
Keyword
32

Which of the following is a valid way to declare and initialize an integer variable?

A
int x = 10;
B
integer x = 10;
C
x = 10;
D
declare int x = 10;
33

The set of rules for a programming language is known as its

A
Grammar
B
Protocol
C
Syntax
D
Logic
34

In the C language, `stdio.h` is an example of a

A
Function
B
Variable
C
Header file
D
Comment
35

Which of the following is NOT a reserved word in C?

A
struct
B
void
C
return
D
variable
36

A character constant in C is enclosed within

A
Double quotes "
B
Single quotes ''
C
Parentheses ()
D
Asterisks **
37

The term 'GUI' in the context of an IDE stands for

A
General User Interface
B
Graphical User Input
C
General Utility Interface
D
Graphical User Interface
38

Which company's labs developed the C language?

A
Microsoft
B
Apple
C
IBM
D
Bell Labs
39

A `char` data type takes up how much memory for storage?

A
1 byte
B
2 bytes
C
4 bytes
D
Depends on the character
40

Which operator is used for initialization in a variable declaration statement?

A
0
B
0
C
@
D
->
41

A compiler translates a source program into a

A
Text file
B
Word document
C
Machine language file
D
PDF file
42

If a variable is declared as `int`, by default it is considered a

A
unsigned int
B
long int
C
short int
D
signed int
43

The range of `signed int` using 4 bytes is approximately

A
0 to 4.2 billion
B
-2.1 billion to +2.1 billion
C
-32,768 to 32,767
D
0 to 65,535
44

What does a text editor in an IDE allow a programmer to do?

A
Compile and run the program
B
Write and edit computer programs
C
Find logical errors
D
Connect to the internet
45

The actual instructions that perform tasks in a C program are written inside the

A
Header section
B
Body of the main function
C
Comment block
D
File name
46

To use mathematical functions like `sqrt()` or `pow()`, which header file should be included?

A
stdio.h
B
conio.h
C
stdlib.h
D
math.h
47

What is the term for the data that is physically stored inside the computer's memory?

A
Software
B
Variable
C
Data
D
Program
48

A collection of all the necessary tools for programming makes up a

A
Programming environment
B
Computer system
C
Software suite
D
Hardware setup
49

If you want to declare multiple variables of the same type, like `int a, b, c;`, what separates them?

A
Semicolon (;)
B
Colon (:)
C
Comma (,)
D
Space
50

Which of the following is NOT a primary data type discussed in the unit?

A
int
B
float
C
char
D
string