PROGRAMMING FOR PROBLEM SOLVING
Unit I · Logic Building
Build the logic, understand the C fundamentals, then reason through expressions. Study one question at a time.
Program development
- 01Define a programming language and name two language levels.2 marks
- 02What is a programming language? Compare machine, assembly and high-level languages.5 marks
- 03List any four stages of program development.2 marks
- 04Explain the stages of program development with an example.5 marks
- 05What are compilation and linking?2 marks
- 06How do you create, compile and run a C program? Explain the translation stages.5 marks
Logic building
- 07State any two essential properties of an algorithm.2 marks
- 08Define an algorithm and explain its essential properties.5 marks
- 09Give two benefits of writing an algorithm before coding.2 marks
- 10Explain the advantages and limitations of algorithms.5 marks
- 11Which flowchart symbols represent input/output and decisions?2 marks
- 12What is a flowchart? Explain the standard symbols and drawing guidelines.5 marks
- 13Define pseudocode and state one advantage.2 marks
- 14What is pseudocode? Explain its conventions with an example.5 marks
- 15State two differences between a flowchart and pseudocode.2 marks
- 16Differentiate an algorithm, a flowchart and pseudocode.5 marks
Worked algorithms
- 17How can the maximum of three values be found using two comparisons?2 marks
- 18Develop an algorithm, pseudocode and flowchart to find the maximum of three numbers.5 marks
- 19Why is a temporary variable used when swapping two values?2 marks
- 20Develop an algorithm and C program to swap two values using a temporary variable.5 marks
- 21Define factorial and state the values of 0! and 5!.2 marks
- 22Develop an algorithm and flowchart to calculate the factorial of a non-negative integer.5 marks
- 23Define a prime number. Is 1 prime?2 marks
- 24Develop a correct algorithm and flowchart to test whether an integer is prime.5 marks
- 25What does the discriminant tell us about quadratic roots?2 marks
- 26Develop an algorithm and flowchart to find the roots of a quadratic equation.5 marks
- 27What are the starting terms and update rule of Fibonacci generation?2 marks
- 28Develop an algorithm and flowchart to generate the first n Fibonacci terms.5 marks
- 29Give the condition for an even integer. Is zero even?2 marks
- 30Draw and explain a flowchart to determine whether an integer is even or odd.5 marks
- 31Write pseudocode to add two numbers.2 marks
- 32Develop an algorithm and flowchart to find the sum of two numbers.5 marks
- 33Why initialise maximum from the first value?2 marks
- 34Develop pseudocode to find the largest value in a given set.5 marks
- 35Why initialise minimum and maximum from the first value?2 marks
- 36Develop an algorithm to find the minimum and maximum in a set.5 marks
C fundamentals
- 37Who developed C? State two characteristics of the language.2 marks
- 38Describe the background and important characteristics of C.5 marks
- 39What does int main(void) mean in a hosted C program?2 marks
- 40Explain the structure of a C program with a complete example.5 marks
- 41State two practical rules for naming identifiers in C.2 marks
- 42What are tokens and identifiers? Explain identifier naming rules in C.5 marks
- 43What does sizeof report? Is int always two bytes?2 marks
- 44Explain the basic C data types, their ranges and how to check their sizes.5 marks
- 45Distinguish declaration from initialisation with an example.2 marks
- 46Define a variable. Explain declaration, initialisation and assignment.5 marks
- 47Distinguish a character constant from a string literal.2 marks
- 48Explain constants, literals and symbolic constant names in C.5 marks
Input and output
Operators
- 53Define unary and binary operators with one example each.2 marks
- 54Classify the operators in C with examples.5 marks
- 55Find the values of 7 / 2 and 7 % 2 in C.2 marks
- 56Explain arithmetic operators, integer division and the remainder operator.5 marks
- 57What is short-circuit evaluation of &&?2 marks
- 58Explain relational, equality and logical operators with short-circuit evaluation.5 marks
- 59Find 12U & 10U and 12U ^ 10U using their low four bits.2 marks
- 60Explain bitwise operators with a worked binary example.5 marks
- 61Write a conditional expression to select the larger of a and b.2 marks
- 62Explain the conditional operator ?: with an example.5 marks
- 63Differentiate ++x and x++ when their expression value is used.2 marks
- 64Differentiate prefix and postfix increment and decrement operators.5 marks
- 65What does total += 5 mean?2 marks
- 66Explain simple and compound assignment operators.5 marks
Expressions and conversions
- 67Distinguish an expression from an expression statement.2 marks
- 68Define an expression and explain how its type affects the result.5 marks
- 69Define precedence and associativity with examples.2 marks
- 70Explain operator precedence and associativity with the correct precedence table.5 marks
- 71Evaluate 8 + 12 / 5 * 2 using integer arithmetic.2 marks
- 72Evaluate C expressions step by step and distinguish grouping from evaluation order.5 marks
- 73What is implicit type conversion? Give an example.2 marks
- 74Explain implicit type conversion, integer promotions and mixed-type arithmetic.5 marks
- 75Why cast before integer division when a fractional result is needed?2 marks
- 76Explain explicit type casting and distinguish casting before and after division.5 marks
No matching questions. Try another word or clear the search field.
The 2- and 5-mark badges indicate practice answer lengths. Previous-paper references retain their actual printed marks.