Introduction to Computing MCQs with Answers
Practice important Introduction to Computing MCQs with answers and explanations.
Chapter: 117
Q1721:
How would you declare a two-dimensional array with two rows and nine columns in C?
A. int Scores[2][9];
B. int Scores(2,9);
C. INTEGER Scores(2,9);
D. int Scores[2x9];
Correct Answer:
A
Chapter: 117
Q1722:
What does the declaration statement struct {char Name[25]; int Age; float SkillRating;} Employee; do?
A. Declares a list of integers
B. Declares an array of characters
C. Declares a structure with different data types
D. Declares a function
Correct Answer:
C
Chapter: 117
Q1723:
In FORTRAN, what would be the index of the second row and fourth column in the array Scores(2,9)?
A. Scores(1,3)
B. Scores[1][3]
C. Scores(2,4)
D. Scores[0][0]
Correct Answer:
C
Chapter: 117
Q1724:
What term is also used to describe an aggregate type in programming?
A. Array
B. Variable
C. Structure
D. Function
Correct Answer:
C
Chapter: 117
Q1725:
Which of the following best describes a one-dimensional list in programming?
A. A table with rows and columns
B. A sequence of elements in a single line
C. A block of heterogeneous data
D. A loop
Correct Answer:
B
Chapter: 117
Q1726:
Fill in the blank: A block of data in which different elements can have different types is called a(n) _______.
A. array
B. aggregate type
C. homogeneous array
D. string
Correct Answer:
B
Chapter: 117
Q1727:
What is the correct way to reference the "Age" field within the "Employee" structure in C?
A. Employee(Age)
B. Employee[Age]
C. Employee.Age
D. Employee
Correct Answer:
C
Chapter: 117
Q1728:
How would you declare an array of 10 integers in C?
A. int Numbers(10);
B. int Numbers[10];
C. int Numbers{10};
D. int Numbers-10;
Correct Answer:
B
Chapter: 117
Q1729:
In programming, which data structure would you use to represent a rectangular table of numeric values?
A. Array
B. List
C. Structure
D. String
Correct Answer:
A
Chapter: 117
Q1730:
What is the significance of specifying the length of each dimension when declaring an array?
A. It determines the number of elements
B. It initializes the array with values
C. It defines the data type of the elements
D. It allocates memory for the array
Correct Answer:
A
Chapter: 117
Q1731:
Which of the following best describes a structure in programming?
A. A collection of elements of the same type
B. A collection of elements of different types
C. A sequence of instructions
D. A block of memory
Correct Answer:
B
Chapter: 117
Q1732:
How would you declare a variable that can store a character string of up to 25 characters in C?
A. int Name[25];
B. char Name[25];
C. float Name[25];
D. string Name[25];
Correct Answer:
B
Chapter: 117
Q1733:
Fill in the blank: The structure declaration struct {char Name[25]; int Age; float SkillRating;} Employee; defines a variable that ____.
A. stores only integer values
B. stores a single character string
C. contains fields with different data types
D. stores a list of floating-point numbers
Correct Answer:
C
Chapter: 117
Q1734:
What is the conceptual layout of the structure Employee as defined in the content?
A. A list of integers
B. A table of strings
C. A block of data with Name, Age, and SkillRating
D. A matrix of floating-point numbers
Correct Answer:
C
Chapter: 117
Q1735:
Which data structure allows elements of different data types to be grouped together?
A. Array
B. Aggregate type
C. One-dimensional list
D. Function
Correct Answer:
B
Chapter: 118
Q1736:
What does an assignment statement do in programming?
A. Declares a variable
B. Executes a function
C. Stores a value in a variable
D. Initializes a loop
Correct Answer:
C
Chapter: 118
Q1737:
Which symbol is used for assignment in C, C++, C#, and Java?
A. :=
B. =
C. ->
D. =:
Correct Answer:
B
Chapter: 118
Q1738:
Fill in the blank: The assignment statement Z = X + Y; in languages like C and Java means that ______.
A. Z is initialized to X + Y
B. X and Y are initialized to Z
C. The sum of X and Y is assigned to Z
D. X is assigned to the value of Z
Correct Answer:
C
Chapter: 118
Q1739:
In which programming language would the assignment statement Z := X + Y; be used?
A. Python
B. C
C. Java
D. Ada
Correct Answer:
D
Chapter: 118
Q1740:
What is the purpose of the semicolon in an assignment statement in many imperative languages?
A. It separates different statements
B. It initializes the variable
C. It terminates the statement
D. It defines the expression
Correct Answer:
C