Unit2 - Subjective Questions

CSE101 • Practice Questions with Detailed Answers

1

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

2

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

3

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

4

Explain the syntax and execution flow of the for loop.

5

Compare the break and continue statements.

6

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

7

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

8

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

9

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

10

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

11

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

12

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

13

What is Structured Programming? List its main advantages.

14

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

15

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

16

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

17

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

18

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

19

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

20

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