Skip to study material

PROGRAMMING FOR PROBLEM SOLVING

Unit I · Logic Building

AR25I Year · I Semester2025–2026

Build the logic, understand the C fundamentals, then reason through expressions. Study one question at a time.

38 topics38 two-mark questions38 five-mark questions16 diagrams and flowcharts20 complete C examplesSeparate viva questions

76 questions

Open complete unit for printing / PDF

Program development

  1. 01Define a programming language and name two language levels.2 marks
  2. 02What is a programming language? Compare machine, assembly and high-level languages.5 marks
  3. 03List any four stages of program development.2 marks
  4. 04Explain the stages of program development with an example.5 marks
  5. 05What are compilation and linking?2 marks
  6. 06How do you create, compile and run a C program? Explain the translation stages.5 marks

Logic building

  1. 07State any two essential properties of an algorithm.2 marks
  2. 08Define an algorithm and explain its essential properties.5 marks
  3. 09Give two benefits of writing an algorithm before coding.2 marks
  4. 10Explain the advantages and limitations of algorithms.5 marks
  5. 11Which flowchart symbols represent input/output and decisions?2 marks
  6. 12What is a flowchart? Explain the standard symbols and drawing guidelines.5 marks
  7. 13Define pseudocode and state one advantage.2 marks
  8. 14What is pseudocode? Explain its conventions with an example.5 marks
  9. 15State two differences between a flowchart and pseudocode.2 marks
  10. 16Differentiate an algorithm, a flowchart and pseudocode.5 marks

Worked algorithms

  1. 17How can the maximum of three values be found using two comparisons?2 marks
  2. 18Develop an algorithm, pseudocode and flowchart to find the maximum of three numbers.5 marks
  3. 19Why is a temporary variable used when swapping two values?2 marks
  4. 20Develop an algorithm and C program to swap two values using a temporary variable.5 marks
  5. 21Define factorial and state the values of 0! and 5!.2 marks
  6. 22Develop an algorithm and flowchart to calculate the factorial of a non-negative integer.5 marks
  7. 23Define a prime number. Is 1 prime?2 marks
  8. 24Develop a correct algorithm and flowchart to test whether an integer is prime.5 marks
  9. 25What does the discriminant tell us about quadratic roots?2 marks
  10. 26Develop an algorithm and flowchart to find the roots of a quadratic equation.5 marks
  11. 27What are the starting terms and update rule of Fibonacci generation?2 marks
  12. 28Develop an algorithm and flowchart to generate the first n Fibonacci terms.5 marks
  13. 29Give the condition for an even integer. Is zero even?2 marks
  14. 30Draw and explain a flowchart to determine whether an integer is even or odd.5 marks
  15. 31Write pseudocode to add two numbers.2 marks
  16. 32Develop an algorithm and flowchart to find the sum of two numbers.5 marks
  17. 33Why initialise maximum from the first value?2 marks
  18. 34Develop pseudocode to find the largest value in a given set.5 marks
  19. 35Why initialise minimum and maximum from the first value?2 marks
  20. 36Develop an algorithm to find the minimum and maximum in a set.5 marks

C fundamentals

  1. 37Who developed C? State two characteristics of the language.2 marks
  2. 38Describe the background and important characteristics of C.5 marks
  3. 39What does int main(void) mean in a hosted C program?2 marks
  4. 40Explain the structure of a C program with a complete example.5 marks
  5. 41State two practical rules for naming identifiers in C.2 marks
  6. 42What are tokens and identifiers? Explain identifier naming rules in C.5 marks
  7. 43What does sizeof report? Is int always two bytes?2 marks
  8. 44Explain the basic C data types, their ranges and how to check their sizes.5 marks
  9. 45Distinguish declaration from initialisation with an example.2 marks
  10. 46Define a variable. Explain declaration, initialisation and assignment.5 marks
  11. 47Distinguish a character constant from a string literal.2 marks
  12. 48Explain constants, literals and symbolic constant names in C.5 marks

Input and output

  1. 49Which scanf formats read float and double values?2 marks
  2. 50Explain printf and scanf with suitable format specifiers.5 marks
  3. 51Why should getchar’s return value be stored in int?2 marks
  4. 52Explain character input/output and safe whole-line input in C.5 marks

Operators

  1. 53Define unary and binary operators with one example each.2 marks
  2. 54Classify the operators in C with examples.5 marks
  3. 55Find the values of 7 / 2 and 7 % 2 in C.2 marks
  4. 56Explain arithmetic operators, integer division and the remainder operator.5 marks
  5. 57What is short-circuit evaluation of &&?2 marks
  6. 58Explain relational, equality and logical operators with short-circuit evaluation.5 marks
  7. 59Find 12U & 10U and 12U ^ 10U using their low four bits.2 marks
  8. 60Explain bitwise operators with a worked binary example.5 marks
  9. 61Write a conditional expression to select the larger of a and b.2 marks
  10. 62Explain the conditional operator ?: with an example.5 marks
  11. 63Differentiate ++x and x++ when their expression value is used.2 marks
  12. 64Differentiate prefix and postfix increment and decrement operators.5 marks
  13. 65What does total += 5 mean?2 marks
  14. 66Explain simple and compound assignment operators.5 marks

Expressions and conversions

  1. 67Distinguish an expression from an expression statement.2 marks
  2. 68Define an expression and explain how its type affects the result.5 marks
  3. 69Define precedence and associativity with examples.2 marks
  4. 70Explain operator precedence and associativity with the correct precedence table.5 marks
  5. 71Evaluate 8 + 12 / 5 * 2 using integer arithmetic.2 marks
  6. 72Evaluate C expressions step by step and distinguish grouping from evaluation order.5 marks
  7. 73What is implicit type conversion? Give an example.2 marks
  8. 74Explain implicit type conversion, integer promotions and mixed-type arithmetic.5 marks
  9. 75Why cast before integer division when a fractional result is needed?2 marks
  10. 76Explain explicit type casting and distinguish casting before and after division.5 marks

The 2- and 5-mark badges indicate practice answer lengths. Previous-paper references retain their actual printed marks.