Skip to study material

PROGRAMMING FOR PROBLEM SOLVING

Previous Exam Questions

Questions are grouped by topic in the current five-unit syllabus, irrespective of the regulation printed on a source paper.

Wording is normalised for readability. Session, paper ID, page and question number identify the source; the displayed marks retain its printed allocation.

191 questions

September/October 2021Q1(a)Paper P01 · p.17 printed marks

What is flow chart? Draw a flowchart to generate Fibonacci sequence up to n numbers.

Unit 1: Logic Building

Study this topic →
September/October 2021Q1(b)Paper P01 · p.18 printed marks

If a variable has auto storage class by default, why was the auto keyword introduced in C? Explain.

Unit 3: Functions and Program Structure

Study the related Unit III topic →
September/October 2021Q2(a)Paper P01 · p.17 printed marks

What is an array? Write a C program for matrix multiplication.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
September/October 2021Q3(b)Paper P01 · p.18 printed marks

What is the use of preprocessor directives? Explain.

Unit 3: Functions and Program Structure

Study the related Unit III topic →
September/October 2021Q6(a)Paper P01 · p.17 printed marks

Define data type. Briefly discuss the fundamental data types supported in C.

Unit 1: Logic Building

Study this topic →
September/October 2021Q6(b)Paper P01 · p.18 printed marks

How is an entry-controlled loop different from an exit-controlled loop? Explain.

Unit 2: Control Statements

Study the related Unit II topic →
September/October 2021Q7(b)Paper P01 · p.18 printed marks

Describe string library functions with syntax and an example program.

Unit 5: Pointers and Strings

Study the related Unit V topic →
March/April 2023Q1(a)Paper P02 · p.12 printed marks

Define a flowchart.

Unit 1: Logic Building

Study this topic →
March/April 2023Q1(b)Paper P02 · p.13 printed marks

How do you declare a variable?

Unit 1: Logic Building

Study this topic →
March/April 2023Q1(i)Paper P02 · p.12 printed marks

What do you mean by time complexity?

Unit 1: Logic Building

Supporting concept for algorithm analysis.

Study this topic →
March/April 2023Q1(j)Paper P02 · p.13 printed marks

Define best-case performance of an algorithm.

Unit 1: Logic Building

Supporting concept for algorithm analysis.

Study this topic →
March/April 2023Q2(a)Paper P02 · p.15 printed marks

Write a detailed note on creating and running a program.

Unit 1: Logic Building

Study this topic →
March/April 2023Q2(b)Paper P02 · p.15 printed marks

Devise an algorithm for the sum of n numbers using while and for loops.

Unit 2: Control Statements

Study the related Unit II topic →
March/April 2023Q3(b)Paper P02 · p.15 printed marks

What is an algorithm? Write an algorithm to find the largest of three numbers.

Unit 1: Logic Building

Study this topic →
March/April 2023Q4(b)Paper P02 · p.15 printed marks

Write a C program to insert a substring into a main string from a given position.

Unit 5: Pointers and Strings

Study the related Unit V topic →
March/April 2023Q5(b)Paper P02 · p.15 printed marks

Write a program to multiply two matrices of size 2 × 2.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
March/April 2023Q8(a)Paper P02 · p.25 printed marks

Discuss types of functions based on parameters and return type.

Unit 3: Functions and Program Structure

Study the related Unit III topic →
March/April 2023Q8(b)Paper P02 · p.25 printed marks

Write a C program using functions to swap two numbers using global variables and the call-by-reference concept.

Unit 3: Functions and Program Structure · Unit 5: Pointers and Strings

Combined question: the printed marks apply to the complete subquestion.

Study the related Unit III topic →Study the related Unit V topic →
March/April 2023Q9(a)Paper P02 · p.25 printed marks

Explain differences between user-defined and library functions.

Unit 3: Functions and Program Structure

Study the related Unit III topic →
March/April 2023Q9(b)Paper P02 · p.25 printed marks

What is recursion? State its advantages and disadvantages.

Unit 3: Functions and Program Structure

Study the related Unit III topic →
March/April 2023Q10(b)Paper P02 · p.25 printed marks

Describe linear search with an example and give its time complexity in all cases.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
March/April 2023Q11(b)Paper P02 · p.25 printed marks

Write an algorithm to sum all elements in an array and find its time complexity.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
June 2022Q1(b)Paper P03 · p.18 printed marks

Explain different type-conversion techniques with examples.

Unit 1: Logic Building

Study this topic →
June 2022Q2(a)Paper P03 · p.17 printed marks

Write a C program to check whether a given number is prime.

Unit 1: Logic Building

Study this topic →
June 2022Q3(a)Paper P03 · p.17 printed marks

What is an array? Describe declaration and initialisation of one- and two-dimensional arrays.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
June 2022Q4(b)Paper P03 · p.18 printed marks

What is a pointer? Write a C program to sum array elements using a pointer.

Unit 5: Pointers and Strings

Study the related Unit V topic →
June 2022Q7(a)Paper P03 · p.17 printed marks

Explain preprocessor commands such as include and define with examples.

Unit 3: Functions and Program Structure

Study the related Unit III topic →
June 2022Q8(a)Paper P03 · p.17 printed marks

Write an algorithm to find the roots of a quadratic equation.

Unit 1: Logic Building

Study this topic →
July 2021Q1(a)Paper P04 · p.17 printed marks

Differentiate declaration and definition of a variable, with examples.

Unit 1: Logic Building

Study this topic →
July 2021Q2(a)Paper P04 · p.15 printed marks

State the purpose of type casting and type conversion.

Unit 1: Logic Building

Study this topic →
July 2021Q3(a)Paper P04 · p.17 printed marks

Using a two-dimensional array, write a C program to transpose a 2 × 2 matrix.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
July 2021Q6(b)Paper P04 · p.17 printed marks

Use conditional compilation to determine whether an identifier is defined.

Unit 3: Functions and Program Structure

Study the related Unit III topic →
July 2021Q7Paper P04 · p.115 printed marks

Illustrate passing arrays to functions with a relevant example program.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
July 2021Q8(a)Paper P04 · p.17 printed marks

Write an algorithm for finding the roots of a quadratic equation.

Unit 1: Logic Building

Study this topic →
March/April 2023Q1(a)Paper P05 · p.11 printed mark

Give an example of an identifier.

Unit 1: Logic Building

Study this topic →
March/April 2023Q1(b)Paper P05 · p.11 printed mark

What is a syntax error?

Unit 1: Logic Building

Study this topic →
March/April 2023Q2(a)Paper P05 · p.14 printed marks

Write pseudocode to find the biggest number in a given set.

Unit 1: Logic Building

Study this topic →
March/April 2023Q2(b)Paper P05 · p.16 printed marks

Give the syntax of while and do-while, explain them and differentiate them.

Unit 2: Control Statements

Study the related Unit II topic →
March/April 2023Q3(a)Paper P05 · p.14 printed marks

Write an algorithm to find the roots of a quadratic equation.

Unit 1: Logic Building

Study this topic →
March/April 2023Q3(b)Paper P05 · p.16 printed marks

List bitwise operators and explain each with its precedence and associativity.

Unit 1: Logic Building

Study this topic →
March/April 2023Q4(a)Paper P05 · p.16 printed marks

Define an array and write C code for matrix multiplication using arrays.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
March/April 2023Q8(a)Paper P05 · p.25 printed marks

What is dynamic memory allocation and why is it required?

Unit 5: Pointers and Strings

Study the related Unit V topic →
March/April 2023Q9(b)Paper P05 · p.26 printed marks

Write C code to print Fibonacci numbers using recursion.

Unit 3: Functions and Program Structure

Study the related Unit III topic →
March/April 2023Q10(a)Paper P05 · p.28 printed marks

Write the linear-search algorithm and explain with an example.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
March/April 2023Q11(a)Paper P05 · p.28 printed marks

What is sorting? Explain selection sort with an example.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
March/April 2023Q11(b)Paper P05 · p.22 printed marks

What is time complexity?

Unit 1: Logic Building

Supporting concept for algorithm analysis.

Study this topic →
September 2023Q1(a)Paper P06 · p.11 printed mark

What is a compiler?

Unit 1: Logic Building

Study this topic →
September 2023Q1(b)Paper P06 · p.11 printed mark

Give one example of a syntax error.

Unit 1: Logic Building

Study this topic →
September 2023Q1(c)Paper P06 · p.11 printed mark

Define the enumeration data type in C.

Unit 1: Logic Building

Study this topic →
September 2023Q1(i)Paper P06 · p.11 printed mark

What is the key difference between linear search and binary search?

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
September 2023Q2(a)Paper P06 · p.15 printed marks

Differentiate object code and executable code in the context of compiling a program.

Unit 1: Logic Building

Study this topic →
September 2023Q4(a)Paper P06 · p.15 printed marks

Differentiate a null-terminated string and a fixed-length string.

Unit 5: Pointers and Strings

Study the related Unit V topic →
September 2023Q5Paper P06 · p.110 printed marks

Discuss the significance of pointers and give practical examples of manipulating data.

Unit 5: Pointers and Strings

Study the related Unit V topic →
September 2023Q7(a)Paper P06 · p.25 printed marks

Explain #ifdef, #ifndef and #endif conditional compilation directives.

Unit 3: Functions and Program Structure

Study the related Unit III topic →
September 2023Q8(a)Paper P06 · p.25 printed marks

Explain freeing memory and the consequences of not freeing it.

Unit 5: Pointers and Strings

Study the related Unit V topic →
September 2023Q8(b)Paper P06 · p.25 printed marks

Discuss limitations of recursion and factors to consider before using it.

Unit 3: Functions and Program Structure

Study the related Unit III topic →
September 2023Q9Paper P06 · p.210 printed marks

Describe parameter passing to functions with example programs.

Unit 3: Functions and Program Structure

Study the related Unit III topic →
September 2023Q10(b)Paper P06 · p.25 printed marks

Define Big O notation and explain its significance for algorithm efficiency.

Unit 1: Logic Building

Supporting concept for algorithm analysis.

Study this topic →
March/April 2023Q1(a)Paper P07 · p.11 printed mark

Define algorithm.

Unit 1: Logic Building

Study this topic →
March/April 2023Q1(b)Paper P07 · p.11 printed mark

What is a compiler?

Unit 1: Logic Building

Study this topic →
March/April 2023Q1(j)Paper P07 · p.11 printed mark

Define Big O notation.

Unit 1: Logic Building

Supporting concept for algorithm analysis.

Study this topic →
March/April 2023Q2(a)Paper P07 · p.15 printed marks

Explain bitwise operators in detail.

Unit 1: Logic Building

Study this topic →
March/April 2023Q2(b)Paper P07 · p.15 printed marks

What is a flowchart? Give its symbols and shapes.

Unit 1: Logic Building

Study this topic →
March/April 2023Q3(b)Paper P07 · p.15 printed marks

Distinguish formatted and unformatted input/output statements.

Unit 1: Logic Building

Study this topic →
March/April 2023Q4(a)Paper P07 · p.15 printed marks

Give syntax for two-dimensional arrays and explain them.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
March/April 2023Q10(b)Paper P07 · p.25 printed marks

Explain linear search for key 77 in 88, 22, 38, 29, 44, 12, 77, 81, 98.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
March/April 2023Q11(a)Paper P07 · p.25 printed marks

Distinguish linear and binary search with an example.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
January/February 2024Q1(a)Paper P08 · p.11 printed mark

List bitwise operators in C.

Unit 1: Logic Building

Study this topic →
January/February 2024Q1(b)Paper P08 · p.11 printed mark

What is the purpose of type conversion?

Unit 1: Logic Building

Study this topic →
January/February 2024Q1(j)Paper P08 · p.11 printed mark

What is the main advantage of binary search over linear search?

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
January/February 2024Q2(a)Paper P08 · p.15 printed marks

Write an algorithm for finding the roots of a quadratic equation.

Unit 1: Logic Building

Study this topic →
January/February 2024Q2(b)Paper P08 · p.15 printed marks

Discuss the importance of flowcharts and pseudocode in designing algorithms.

Unit 1: Logic Building

Study this topic →
January/February 2024Q3(b)Paper P08 · p.15 printed marks

Explain types of errors with examples.

Unit 1: Logic Building

Study this topic →
January/February 2024Q4(a)Paper P08 · p.14 printed marks

Explain how to define and use an enumeration data type in C.

Unit 1: Logic Building

Study this topic →
January/February 2024Q4(b)Paper P08 · p.16 printed marks

Compare character arrays and string literals. Explain strings as arrays of characters.

Unit 5: Pointers and Strings

Study the related Unit V topic →
January/February 2024Q5(a)Paper P08 · p.16 printed marks

Describe creating and initialising a one-dimensional array, with an example.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
January/February 2024Q8Paper P08 · p.210 printed marks

Describe allocation and deallocation using malloc and free, with a program.

Unit 5: Pointers and Strings

Study the related Unit V topic →
January/February 2024Q9(b)Paper P08 · p.25 printed marks

Write a C program to calculate factorial using recursion.

Unit 3: Functions and Program Structure

Study the related Unit III topic →
January/February 2024Q10Paper P08 · p.210 printed marks

Explain binary search in detail with an example.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
January/February 2024Q11Paper P08 · p.210 printed marks

Explain the key steps of insertion sort with an example.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
September 2023Q1(a)Paper P09 · p.12 printed marks

Draw a flowchart to find whether a number is even or odd.

Unit 1: Logic Building

Study this topic →
September 2023Q1(b)Paper P09 · p.13 printed marks

What are operator precedence rules?

Unit 1: Logic Building

Study this topic →
September 2023Q1(j)Paper P09 · p.13 printed marks

Write an algorithm to find the sum of two numbers.

Unit 1: Logic Building

Study this topic →
September 2023Q2(a)Paper P09 · p.13 printed marks

Explain stdin, stdout and stderr with examples.

Unit 1: Logic Building

Study this topic →
September 2023Q2(b)Paper P09 · p.17 printed marks

Write a C program to print the pattern whose row i contains i copies of the number i, for rows 1 to 5.

Unit 2: Control Statements

Study the related Unit II topic →
September 2023Q3(b)Paper P09 · p.14 printed marks

What is the ternary operator? Write the syntax of switch-case.

Unit 1: Logic Building · Unit 2: Control Statements

Combined question: the printed marks apply to the complete subquestion.

Study this topic →Study the related Unit II topic →
September 2023Q4(a)Paper P09 · p.15 printed marks

Multiply two matrices and store the result in a third matrix using C.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
September 2023Q5(b)Paper P09 · p.15 printed marks

Explain enumeration data type.

Unit 1: Logic Building

Study this topic →
September 2023Q7(a)Paper P09 · p.25 printed marks

What are preprocessing commands? Distinguish #ifdef and #ifndef.

Unit 3: Functions and Program Structure

Study the related Unit III topic →
September 2023Q8(a)Paper P09 · p.25 printed marks

Write a program to swap two numbers using call-by-value parameter passing.

Unit 3: Functions and Program Structure

Study the related Unit III topic →
September 2023Q9(a)Paper P09 · p.26 printed marks

Find the sum of squares of the first N natural numbers using recursion.

Unit 3: Functions and Program Structure

Study the related Unit III topic →
September 2023Q10(a)Paper P09 · p.27 printed marks

Give bubble sort and sort 55, 96, 61, 99, 14, 87, 112, 135, 567, 16.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
September 2023Q11(a)Paper P09 · p.26 printed marks

Write an algorithm to find minimum and maximum values in a given set.

Unit 1: Logic Building

Study this topic →
September 2023Q11(b)Paper P09 · p.24 printed marks

Explain the principle of insertion sort and derive its time complexity.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
January/February 2024Q1(a)Paper P10 · p.12 printed marks

Differentiate extern and static storage classes.

Unit 3: Functions and Program Structure

Study the related Unit III topic →
January/February 2024Q1(b)Paper P10 · p.13 printed marks

What is the need for type conversion? Explain.

Unit 1: Logic Building

Study this topic →
January/February 2024Q1(i)Paper P10 · p.12 printed marks

Give the time complexities of bubble sort and insertion sort.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
January/February 2024Q3(a)Paper P10 · p.14 printed marks

What is a flowchart? Explain how it represents algorithms.

Unit 1: Logic Building

Study this topic →
January/February 2024Q3(b)Paper P10 · p.16 printed marks

Discuss the role of operator precedence in expression evaluation, with examples.

Unit 1: Logic Building

Study this topic →
January/February 2024Q4(a)Paper P10 · p.14 printed marks

Give the syntax of strlen, strcat, strcpy and strstr.

Unit 5: Pointers and Strings

Study the related Unit V topic →
January/February 2024Q4(b)Paper P10 · p.16 printed marks

Count occurrences of a character in a string using C.

Unit 5: Pointers and Strings

Study the related Unit V topic →
January/February 2024Q5(a)Paper P10 · p.14 printed marks

Explain initialisation of one- and two-dimensional arrays with examples.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
January/February 2024Q5(b)Paper P10 · p.16 printed marks

Find the second largest and second smallest numbers in an array using C.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
January/February 2024Q7(a)Paper P10 · p.24 printed marks

What are preprocessor commands, why are they needed, and give examples.

Unit 3: Functions and Program Structure

Study the related Unit III topic →
January/February 2024Q9(a)Paper P10 · p.25 printed marks

Define dynamic memory allocation; explain calloc and malloc.

Unit 5: Pointers and Strings

Study the related Unit V topic →
January/February 2024Q9(b)Paper P10 · p.25 printed marks

Explain passing an entire array as an argument to a function, with an example.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
January/February 2024Q10(a)Paper P10 · p.27 printed marks

Write linear search and explain with an example.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
January/February 2024Q10(b)Paper P10 · p.23 printed marks

Give best-, average- and worst-case time complexities of linear search.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →
January/February 2024Q11Paper P10 · p.210 printed marks

Write and explain selection sort with an example and its time complexity.

Unit 4: Arrays, Searching and Sorting

Study the related Unit IV topic →

Source papers

Paper IDs distinguish different supplied papers from the same examination session.