Programming for Problem Solving (PPS) - CT1
Expert Examiner Solutions | Zero-Mark Deduction Format
Question 1
Who is father of C Language?
  • A. Bjarne Stroustrup
  • B. Dennis Ritchie
  • C. James A. Gosling
  • D. Dr. E.F. Codd
Click to Reveal Answer & Solution
Correct Answer: B. Dennis Ritchie
Detailed Reason:
Dennis Ritchie is the creator of the C programming language. He developed it at Bell Labs in the early 1970s. Bjarne Stroustrup created C++, James Gosling created Java, and Dr. E.F. Codd invented the relational database model.
Question 2
C Language developed at _____?
  • A. AT & T's Bell Laboratories of USA in 1972
  • B. AT & T's Bell Laboratories of USA in 1970
  • C. Sun Microsystems in 1973
  • D. Cambridge University in 1972
Click to Reveal Answer & Solution
Correct Answer: A. AT & T's Bell Laboratories of USA in 1972
Detailed Reason:
C was developed by Dennis Ritchie at AT&T's Bell Laboratories in 1972 as an evolution of the earlier B language (developed by Ken Thompson) primarily to write the UNIX operating system.
Question 3
For 16-bit compiler allowable range for integer constants is ______ ?
  • A. -3.4e38 to 3.4e38
  • B. -32767 to 32768
  • C. -32768 to 32767
  • D. -32668 to 32667
Click to Reveal Answer & Solution
Correct Answer: C. -32768 to 32767
Detailed Reason:
In a 16-bit compiler (like Turbo C), a signed integer takes 16 bits (2 bytes) of memory. The formula for the range of a signed integer of $n$ bits is from $-2^{(n-1)}$ to $2^{(n-1)} - 1$. For $n=16$, this is $-2^{15}$ to $2^{15}-1$, which equals -32768 to 32767.
Question 4
C programs are converted into machine language with the help of
  • A. An Editor
  • B. A compiler
  • C. An operating system
  • D. None of the above
Click to Reveal Answer & Solution
Correct Answer: B. A compiler
Detailed Reason:
A compiler is a system software that translates the entire high-level source code (like C) into low-level machine code (binary) at once before execution. An editor is just for typing the code, and an operating system manages hardware.
Question 5
A C variable cannot start with
  • A. An alphabet
  • B. A number
  • C. A special symbol other than underscore
  • D. both (b) and (c)
Click to Reveal Answer & Solution
Correct Answer: D. both (b) and (c)
Detailed Reason:
According to C naming conventions for identifiers: a variable name MUST start with an alphabet or an underscore. It cannot start with a number, and it cannot contain or start with any special symbol other than the underscore. Therefore, both B and C are invalid starting characters.
Question 6
Which of the following is allowed in a C Arithmetic Instruction?
  • A. []
  • B. {}
  • C. ()
  • D. None of the above
Click to Reveal Answer & Solution
Correct Answer: C. ()
Detailed Reason:
In C arithmetic expressions, only parentheses () are allowed to explicitly define the precedence (order of evaluation) of operators. Square brackets [] are reserved for array indexing, and curly braces {} are used to define blocks of code (like loops or functions).
Question 7
Which of the following shows the correct hierarchy of arithmetic operations in C
  • A. / + * -
  • B. * - / +
  • C. + - / *
  • D. * / + -
Click to Reveal Answer & Solution
Correct Answer: D. * / + -
Detailed Reason:
In C, the precedence of arithmetic operators follows standard mathematical rules (BODMAS/PEMDAS). Multiplication (*), division (/), and modulus (%) share the highest priority. Addition (+) and subtraction (-) share a lower priority. If operators have the same priority, associativity applies (left-to-right). Thus, * and / come before + and -.
Question 8
Program which is written originally by the programmer is classified as
  • A. object code
  • B. machine code
  • C. source program
  • D. interactive programs
Click to Reveal Answer & Solution
Correct Answer: C. source program
Detailed Reason:
The human-readable code written directly by the programmer in a high-level language (like C) is called the source program (or source code). When compiled, it becomes object code, and finally executable machine code.
Question 9
Data types are differed on the basis of
  • A. the way of storage
  • B. the type of operations
  • C. the type of operators used
  • D. both a and b
Click to Reveal Answer & Solution
Correct Answer: D. both a and b
Detailed Reason:
Data types (like int, float, char) differ based on the way they are stored in memory (size in bytes and encoding format, e.g., two's complement for int, IEEE 754 for float) and the type of operations that are mathematically and logically permissible on them (e.g., bitwise operations work on ints, but not floats).
Question 10
Loop statement which is repeated for some given number of times is classified as
  • A. FOR loop
  • B. GO loop
  • C. REPEAT loop
  • D. GO REPEAT loop
Click to Reveal Answer & Solution
Correct Answer: A. FOR loop
Detailed Reason:
In C, when the number of iterations is known beforehand, the FOR loop is the standard construct used. It consolidates initialization, condition checking, and increment/decrement into a single, clean line.
Question 11
Type of statement written in sequence and is repeated until the specific condition met is classified as
  • A. format
  • B. loop
  • C. case
  • D. condition
Click to Reveal Answer & Solution
Correct Answer: B. loop
Detailed Reason:
A loop (such as while or do-while) is a control flow statement that allows code to be executed repeatedly based on a given boolean condition. It repeats until the condition evaluates to false.
Question 12
Size of an array is declared by
  • A. programmer
  • B. program users
  • C. software
  • D. declared automatically
Click to Reveal Answer & Solution
Correct Answer: A. programmer
Detailed Reason:
In C (specifically C89/C90), the size of a standard static array must be explicitly declared by the programmer at compile time using a constant expression (e.g., int arr[10];). Dynamic sizing requires manual memory allocation using pointers.
Question 13
Programming language 'FORTRAN' stands for
  • A. formula translator
  • B. formula translation
  • C. free translator
  • D. free translation
Click to Reveal Answer & Solution
Correct Answer: B. formula translation
Detailed Reason:
FORTRAN, developed by IBM in the 1950s for scientific and engineering applications, is an acronym derived from FORmula TRANslation.
Question 14
Functions that are used in the programs and are defined by the programmers are called
  • A. program layout
  • B. program procedure
  • C. built-in functions
  • D. user-defined function
Click to Reveal Answer & Solution
Correct Answer: D. user-defined function
Detailed Reason:
Functions in C are categorized into two types: Library Functions (built-in, like printf or scanf) and User-defined Functions (created by the programmer to perform specific customized tasks).
Question 15
An assembler translates
  • A. machine code into assembly code
  • B. assembly code into machine code
  • C. processing time into manual time
  • D. routine into subroutine
Click to Reveal Answer & Solution
Correct Answer: B. assembly code into machine code
Detailed Reason:
An assembler is a program that takes low-level assembly language (which uses mnemonics like ADD, MOV) and translates it directly into binary machine code (0s and 1s) that the CPU can execute.
Question 16
Name given by a programmer to any particular data is classified as
  • A. identifier
  • B. identification
  • C. exponent
  • D. mantissa
Click to Reveal Answer & Solution
Correct Answer: A. identifier
Detailed Reason:
In C programming, an identifier is the technical term for a name given to entities such as variables, functions, structures, and arrays to uniquely identify them during the execution of the program.
Question 17
When variable used in program is whole number, the variable is stored as
  • A. fixed string
  • B. integers
  • C. negative whole numbers
  • D. positive whole numbers
Click to Reveal Answer & Solution
Correct Answer: B. integers
Detailed Reason:
Whole numbers (numbers without fractional or decimal parts, like -5, 0, or 42) are classified and stored using the integer (int) data type in memory.
Question 18
In programming, programmers use comments to
  • A. highlight program modules
  • B. explain module functions
  • C. explain used variables
  • D. all of above
Click to Reveal Answer & Solution
Correct Answer: D. all of above
Detailed Reason:
Comments (// or /* */) are non-executable statements used heavily by programmers to document their code. They are used to highlight sections, explain complex logic/functions, define the purpose of variables, and increase overall code maintainability for other developers.
Question 19
Variable which uses the same name in whole program and in its all routines thus best classified as
  • A. middle variable
  • B. default variable
  • C. local variable
  • D. global variable
Click to Reveal Answer & Solution
Correct Answer: D. global variable
Detailed Reason:
A variable declared outside of all functions (at the top of the file) is known as a global variable. It can be accessed and modified by any function (routine) throughout the entire program's lifecycle.
Question 20
Statement which is used to make choice between two options and only option is to be performed is written as
  • A. if statement
  • B. if else statement
  • C. then else statement
  • D. else one statement
Click to Reveal Answer & Solution
Correct Answer: B. if else statement
Detailed Reason:
The if-else statement provides a two-way decision path. It evaluates a boolean condition: if true, it executes the if block; if false, it executes the alternative else block. Only one of the two options is ever executed.