Unit 5: Control Statement
1. What are the different control structure used in C-programming? Explain briefly.
2. What is control statement? Write a program which select and print largest among 3
numbers using if else statement with flowchart.
3. Discuss different types of decision making statements in C with their syntax.
4. Differentiate between if-else and if statement with example.
5. What is branching? Explain about the branching statement.
6. What is looping? Explain about different looping with example.
7. Compare between do while and for loops with an example.
8. Differentiate between while loop and do-while loop with an example.
9. Differentiate between break, continue, and return statement.
10. What is switch statement? Explain with syntax and flowchart.
11. Write a menu driven program using switch to perform the following tasks:
a. To find the factorial of a given integer.
b. To find the multiplication table upto nth number
c. To check the given number is palindrome or not
d. Exit
12. What is nested loop? Write a program to print the following pattern.
$ $
$ $ $
$ $ $ $
$ $ $ $ $
13. Write a program to print the following pattern.
1 2
1 2 3
1 2 3 4
1 2 3 4 5
14. Write a program to print the following pattern.
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
15. Write a program to read four digit number and print its reverse number.
e.g. input=1234, output=4321
16. Write a program that uses a while loop to compute and print the sum of a given number
of squares. For example, if 4 is the input, then the program will print 30, which is equal to
12+22+32+42.