Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 2 subjective questions Principles of programming

CAP1008 — C Programming 20 questions with model answers. Write yours first, then compare.

Read the notes Practice MCQs
  1. Question 1 of 20

    Explain the basic structure of a C program with the help of a suitable example. Describe each section briefly.

  2. Question 2 of 20

    What is a character set in C? Describe the different categories of characters used in the C language.

  3. Question 3 of 20

    Define identifiers and keywords. State the rules for constructing valid identifiers in C.

  4. Question 4 of 20

    Distinguish between constants and variables. Explain the different types of constants in C with examples.

  5. Question 5 of 20

    Explain the primary (basic) data types available in C along with their typical size and range.

  6. Question 6 of 20

    Differentiate between formatted and unformatted I/O functions in C with examples.

  7. Question 7 of 20

    Explain the working of printf() and scanf() functions with syntax, format specifiers, and examples.

  8. Question 8 of 20

    Describe the functions puts(), gets(), getchar(), and putchar() with their syntax and examples.

  9. Question 9 of 20

    What is an expression in C? Explain the different types of expressions with examples.

  10. Question 10 of 20

    Explain the arithmetic operators in C. Discuss integer arithmetic, real arithmetic, and mixed-mode arithmetic with examples.

  11. Question 11 of 20

    What are unary operators? Explain increment and decrement operators, distinguishing between prefix and postfix forms with examples.

  12. Question 12 of 20

    Explain relational operators in C. Write a program to demonstrate their use.

  13. Question 13 of 20

    Explain logical operators in C with truth tables and examples.

  14. Question 14 of 20

    Explain the assignment operator and its shorthand (compound) forms in C with examples.

  15. Question 15 of 20

    Explain the conditional (ternary) operator in C with its syntax and an example program.

  16. Question 16 of 20

    Explain bitwise operators in C in detail. Illustrate each operator with an example.

  17. Question 17 of 20

    What is type conversion in C? Explain implicit and explicit type conversion with examples.

  18. Question 18 of 20

    Explain type modifiers (qualifiers) in C. Describe signed, unsigned, short, and long with their effect on data types.

  19. Question 19 of 20

    Explain operator precedence and associativity in C. Evaluate the expression a = 5 + 3 * 2 - 8 / 4 step by step.

  20. Question 20 of 20

    Write a complete C program to accept two integers from the user and display their sum, difference, product, quotient, and remainder. Explain the program with proper use of I/O and arithmetic operators.

That's unit 2

Long answers stick best when they're tested again soon. Run the MCQs on this unit, then come back to the questions you found hardest.