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 Control structures and Input/Output functions

CSE101 — Computer Programming 20 questions with model answers. Write yours first, then compare.

Read the notes Practice MCQs
  1. Question 1 of 20

    Explain the switch-case statement in C with its syntax. What is the role of the break and default keywords?

  2. Question 2 of 20

    Differentiate between Entry-Controlled and Exit-Controlled loops with examples.

  3. Question 3 of 20

    Describe the Type Conversion mechanism in C. Differentiate between Implicit and Explicit type casting.

  4. Question 4 of 20

    Explain the syntax and execution flow of the for loop.

  5. Question 5 of 20

    Compare the break and continue statements.

  6. Question 6 of 20

    Write a C program using a while loop to calculate the sum of digits of a number given by the user.

  7. Question 7 of 20

    What are Data Type Modifiers in C? List and explain them.

  8. Question 8 of 20

    Explain the printf() function with respect to format specifiers, width, and precision.

  9. Question 9 of 20

    Discuss the scanf() function. Why do we use the ampersand (&) operator with variables in scanf?

  10. Question 10 of 20

    Differentiate between Formatted and Unformatted I/O functions with examples.

  11. Question 11 of 20

    What is the goto statement? Why is its usage generally discouraged in structured programming?

  12. Question 12 of 20

    Explain the usage of puts() and gets() functions. How does gets() differ from scanf("%s", ...)?

  13. Question 13 of 20

    What is Structured Programming? List its main advantages.

  14. Question 14 of 20

    Write a C program to check if a number is Prime or not using a for loop.

  15. Question 15 of 20

    Explain the concept of Nested Loops. Provide an example to print a right-angled triangle pattern.

  16. Question 16 of 20

    What is the return statement? Can a function have multiple return statements?

  17. Question 17 of 20

    Write a C program to find the roots of a Quadratic Equation () using if-else ladders.

  18. Question 18 of 20

    Explain the "Dangling Else" problem in C programming and how it is resolved.

  19. Question 19 of 20

    Compare the while and do-while loops with suitable syntax.

  20. Question 20 of 20

    Write a C program to reverse a given number using a loop.

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.