GNG1106 LECTURE 3 EXAM QUESTIONS
AND ANSWERS GRADED A+ 2025/2026
Conversion Specifiers - ANS Used in scanf and printf to define how data types are formatted.
printf - ANS A function used to output formatted data to the standard output.
scanf - ANS A function used to read formatted input from the standard input.
short - ANS Data type with conversion specifiers %d, %i, %hd, %hi for printf and %hd, %hi for
scanf.
int - ANS Data type with conversion specifiers %d, %i for both printf and scanf.
long - ANS Data type with conversion specifiers %ld, %li for printf and %ld, %li for scanf.
unsigned short - ANS Data type with conversion specifier %hu for both printf and scanf.
unsigned int - ANS Data type with conversion specifier %u for both printf and scanf.
unsigned long - ANS Data type with conversion specifier %lu for both printf and scanf.
1 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.
, float - ANS Data type with conversion specifiers %f, %e, %E, %g, %G for printf and %f, %e, %E,
%g, %G for scanf.
double - ANS Data type with conversion specifiers %f, %e, %E, %g, %G for printf and %lf, %le,
%lE, %lg, %lG for scanf.
long double - ANS Data type with conversion specifiers %Lf, %Le, %LE, %Lg, %LG for both
printf and scanf.
%e and %E - ANS Conversion specifiers for scientific notation in printf.
Width and Precision Formatting - ANS Specifies the maximum width (x) and precision (y) of
the number in printf.
bit - ANS A single digit in binary representation, taking value 0 or 1.
byte - ANS A string of 8 bits.
Binary Representation - ANS The format in which data and programs are represented inside a
computer using 0s and 1s.
Encoding - ANS The process of converting numbers to bytes, which is machine-dependent.
Fixed-point encoding - ANS A type of encoding that converts between bytes and integers.
Floating-point encoding - ANS A type of encoding used for representing real numbers in a
way that can support a wide range of values.
Maximum configurations of a byte - ANS A byte can take 256 different configurations (2^8).
2 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.
AND ANSWERS GRADED A+ 2025/2026
Conversion Specifiers - ANS Used in scanf and printf to define how data types are formatted.
printf - ANS A function used to output formatted data to the standard output.
scanf - ANS A function used to read formatted input from the standard input.
short - ANS Data type with conversion specifiers %d, %i, %hd, %hi for printf and %hd, %hi for
scanf.
int - ANS Data type with conversion specifiers %d, %i for both printf and scanf.
long - ANS Data type with conversion specifiers %ld, %li for printf and %ld, %li for scanf.
unsigned short - ANS Data type with conversion specifier %hu for both printf and scanf.
unsigned int - ANS Data type with conversion specifier %u for both printf and scanf.
unsigned long - ANS Data type with conversion specifier %lu for both printf and scanf.
1 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.
, float - ANS Data type with conversion specifiers %f, %e, %E, %g, %G for printf and %f, %e, %E,
%g, %G for scanf.
double - ANS Data type with conversion specifiers %f, %e, %E, %g, %G for printf and %lf, %le,
%lE, %lg, %lG for scanf.
long double - ANS Data type with conversion specifiers %Lf, %Le, %LE, %Lg, %LG for both
printf and scanf.
%e and %E - ANS Conversion specifiers for scientific notation in printf.
Width and Precision Formatting - ANS Specifies the maximum width (x) and precision (y) of
the number in printf.
bit - ANS A single digit in binary representation, taking value 0 or 1.
byte - ANS A string of 8 bits.
Binary Representation - ANS The format in which data and programs are represented inside a
computer using 0s and 1s.
Encoding - ANS The process of converting numbers to bytes, which is machine-dependent.
Fixed-point encoding - ANS A type of encoding that converts between bytes and integers.
Floating-point encoding - ANS A type of encoding used for representing real numbers in a
way that can support a wide range of values.
Maximum configurations of a byte - ANS A byte can take 256 different configurations (2^8).
2 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.