Programming in C MCQ - Constants, Variables and Data Types

Correct AnswerOption C
Rate difficulty Rate difficulty:
Choose a difficulty.
A comment is used to document source code and is ignored by the compiler as executable program logic. C supports block comments enclosed between /* and */ and, since C99, single-line comments beginning with //. Comments improve readability but do not change the result of a correctly written program.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Correct AnswerOption B
Rate difficulty Rate difficulty:
Choose a difficulty.

In signed magnitude form, one bit is dedicated to store the sign(e.g., 1 for negative and otherwise). Only the remaining 15 bits are available to store the magnitude. Hence the answer.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Correct AnswerOption D
Rate difficulty Rate difficulty:
Choose a difficulty.

Without any temporary variable, one can swap two given variables.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Correct AnswerOption C
Rate difficulty Rate difficulty:
Choose a difficulty.
Share this question
Share:
Swapping two integer variables means exchanging their values. If s initially contains 10 and b contains 20, after swapping, s contains 20 and b contains 10. A temporary variable is one common way to perform the exchange.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Correct AnswerOption A
Rate difficulty Rate difficulty:
Choose a difficulty.
For an integer representation using two bytes, there are 16 bits in total. A signed integer commonly uses one bit to represent the sign and the remaining 15 bits for the magnitude or value representation, depending on the signed integer representation. In modern two-complement systems, a signed 16-bit integer normally ranges from -32768 to 32767. The C language does not guarantee that int occupies exactly two bytes.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Why Practice with Avatto?
High Quality MCQsExam-focused questions with accurate answers
Detailed ExplanationsStep-by-step explanations to enhance learning
Latest Exam PatternBased on updated syllabus and pattern
Performance AnalyticsTrack performance and improve weak areas
100% Free PracticePractice unlimited questions for free