0% found this document useful (0 votes)
4 views

C Control Statements Practice Questions

This document contains a list of practice questions designed to reinforce understanding of control and conditional statements in C programming. It includes tasks such as checking even or odd numbers, performing arithmetic operations, determining the largest of three numbers, and implementing loops and conditional statements. Each question encourages implementation and testing of edge cases to enhance coding skills.

Uploaded by

officialmaha204
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

C Control Statements Practice Questions

This document contains a list of practice questions designed to reinforce understanding of control and conditional statements in C programming. It includes tasks such as checking even or odd numbers, performing arithmetic operations, determining the largest of three numbers, and implementing loops and conditional statements. Each question encourages implementation and testing of edge cases to enhance coding skills.

Uploaded by

officialmaha204
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Practice Questions on Control & Conditional Statements in C

These practice problems will help reinforce your understanding of control and conditional statements in C.
Try implementing each one and testing edge cases!

1. Write a C program to check if a number is even or odd using if-else.


2. Modify the above to also handle negative numbers with a separate message.
3. Create a program using switch-case to perform +, -, *, / operations on two integers.
4. Write a program that uses nested if to determine the largest of three numbers.
5. Write a loop that prints all even numbers from 1 to 100 using a for loop.
6. Convert the above program using a while loop.
7. Write a program that prints a multiplication table of a given number using do-while.
8. Implement a program to sum digits of a number using a while loop.
9. Write a program to print numbers from 10 to 1 using a decrementing for loop.
10. Create a program that counts the number of positive and negative numbers entered by the user until 0 is entered.
11. Write a program to demonstrate break statement inside a loop to exit on a specific condition.
12. Write a program using continue statement to skip printing multiples of 3 from 1 to 20.
13. Develop a menu-driven program using switch to simulate a basic calculator.
14. Write a program with a nested if-else to check if a year is a leap year.
15. Create a program that prints the pattern below using nested loops:■ 1■ 1 2■ 1 2 3■ 1 2 3 4
16. Write a program to find factorial of a number using while loop.
17. Create a program to reverse a number using a do-while loop.
18. Write a program to print all prime numbers between 1 and 100 using nested loops.
19. Implement a program to check if a character is a vowel or consonant using switch.
20. Write a program that demonstrates the use of ternary operator instead of if-else.

You might also like