Machine-translated by Google. Questions are authored in English.
Top

Fundamentals Questions and Answers

1.

int main() {
    int x
    x = (1 + 2;
    return x;
}

Which of the following statements is true with respect to this source code in C language ?

Exam Year(s)

MH SET - 2025, SET Exam - 2025,

Answer: A

The code has a syntax error.

int x lacks the semicolon that ends a declaration, and x = (1 + 2; has an opening parenthesis with no closing one. Both break the grammar of C, so the compiler's parser rejects the program before it is ever linked or run.

A semantic error is grammatically valid code with a wrong meaning, such as a type mismatch. A linking error arises when a referenced function or variable cannot be found. A runtime error occurs while a compiled program runs. None can happen here because the code does not compile.

Please log in or register to report this question.

2.

C programs are converted into machine language with the help of

Exam Year(s)

Tripura Public Service Commission - 2019,

Answer: B

C programs are converted into machine language by a compiler.

A compiler translates the whole C source program into machine code (an object file), which the linker combines with library code into an executable.

An editor is only used to write and change the source text, and the operating system loads and runs the finished program; neither translates it. Since a compiler does, 'None of the above' is wrong.

Please log in or register to report this question.

3.

Which symbol is used for single-line comments in C ?

Exam Year(s)

Tripura Public Service Commission - 2026,

Answer: C

Single-line comments in C use //.

Everything after // up to the end of the line is ignored by the compiler. This style, borrowed from C++, became part of standard C in C99.

/* ... */ marks a multi-line (block) comment, which needs both an opening and a closing mark. # begins a preprocessor directive such as #include, and a single / is the division operator.

Please log in or register to report this question.

4.

C Language is a _________

Exam Year(s)

UGC NET - 2012,

Answer: D

C is called a middle level language (option D) because it combines the features of a high level language, such as functions and structured control, with low level features, such as pointers, bit operations and direct access to memory addresses.

It is not purely high level (A), since it gives machine-near control that languages like Java hide. It is not a low level language (B), since it is independent of machine instructions, and it is not machine language (C), which is binary code.

Please log in or register to report this question.

5.

If an integer needs two bytes of storage, then the maximum value of a signed integer is

Exam Year(s)

UGC NET - 2012,

Answer: B

The maximum signed integer in two bytes is \(2^{15} - 1\).

Two bytes are 16 bits. In two's complement the top bit is the sign, which leaves 15 bits for the value:

\[ \text{max} = 2^{15} - 1 = 32767 \]

\(2^{16} - 1\) is 65535, the largest unsigned value in two bytes. \(2^{16}\) and \(2^{15}\) are one more than the largest unsigned and signed values, so no 16-bit integer can reach them.

Please log in or register to report this question.

6.

Match the following with respect to programming languages :

List - IList - II
a. Structured Languagei. JAVA
b. Non-structured Languageii. BASIC
c. Object Oriented Programming Languageiii. PASCAL
d. Interpreted Programming Languageiv. FORTRAN

Codes : a b c d

Exam Year(s)

UGC NET - 2013,

Answer: A

The match is a-iii, b-iv, c-i, d-ii. PASCAL is a structured language (iii). FORTRAN, in its classic form, is a non-structured language (iv). JAVA is an object oriented programming language (i). BASIC is the interpreted programming language (ii).

The alternative codes put BASIC or FORTRAN as the structured language, or JAVA as the interpreted one, which does not fit these languages.

Please log in or register to report this question.

Answer: C

C and C++ are not strongly typed languages because they allow functions for which the parameters are not type checked and because union types are not type checked. Both are given in the third option.

The option saying the parameters are type checked is the opposite. The options naming only one of the two reasons, either the functions or the unions, are incomplete, since the key counts both.

Please log in or register to report this question.

8.

Code blocks allow many algorithms to be implemented with the following parameters :

Exam Year(s)

UGC NET - 2014,

Answer: B

Code blocks allow many algorithms to be implemented with clarity, elegance and efficiency.

In C and C++ a code block groups statements as a logical unit, and Schildt notes that blocks let many algorithms be written with clarity, elegance and efficiency.

The other options replace efficiency with performance or execution, which is not the wording of the standard statement.

Please log in or register to report this question.

9.

C programming language can be considered as

1. Low level programming
2. High level programming
3. Assembly level programming
4. Machine level programming

Exam Year(s)

UGC NET - 2014,

Answer: C

The keyed answer is 1 and 2. C is a high-level language, with structured statements and functions that are independent of the machine, and it also provides low-level features such as pointers, bit operations and direct access to memory and hardware. For that reason it is described as both low level and high level.


It is not an assembly level language, because assembly code uses mnemonics tied to one processor's instruction set, and it is not a machine level language, because it is not written in binary instruction codes. Options with 3 or 4 are wrong.

Please log in or register to report this question.

10.

Before a disk drive can access any sector record, a computer program has to provide the record’s disk address. What information does this address specify?

Answer: D

Correct answer: All of above

A disk address must identify the sector uniquely, and that takes all three coordinates: which surface (which platter and which side of it), which track on that surface, and which sector along the track. This is the classic cylinder-head-sector scheme.

Please log in or register to report this question.

Loading…

Other Subjects

Tags: Fundamentals Questions and Answers || Fundamentals MCQ Questions and Answers || Fundamentals GK Questions and Answers || Fundamentals GK MCQ Questions || Fundamentals Multiple Choice Questions and Answers || Fundamentals GK || GK on Fundamentals || C Programming Questions and Answers || C Programming MCQ Questions and Answers || C Programming GK Questions and Answers || GK on C Programming