0% found this document useful (0 votes)
6 views4 pages

C Programming: Control Statements Practice

The document outlines various programming exercises in C, focusing on conditional statements like if, if-else, and switch-case. It includes tasks for checking voting eligibility based on age, identifying even and odd numbers, displaying numbers, generating multiplication tables, and handling traffic light signals. Additionally, it emphasizes the use of loops, specifically while and for loops, for various numerical outputs.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

C Programming: Control Statements Practice

The document outlines various programming exercises in C, focusing on conditional statements like if, if-else, and switch-case. It includes tasks for checking voting eligibility based on age, identifying even and odd numbers, displaying numbers, generating multiplication tables, and handling traffic light signals. Additionally, it emphasizes the use of loops, specifically while and for loops, for various numerical outputs.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Program for Practice –if and if-else statement.

1. Write a C program to check whether a person is eligible to vote


based on age using if statement.
2. Write a C program to check whether a person is eligible to vote
or not based on age using if-else statement.
3. Write a C program to identify whether a number is even using if
statement.
Hint----Condition is num % 2 == 0
4. Write a C program to identify whether a number is even or odd
using if-else statement.
Hint----Condition is num % 2 == 0
1. Write a C program to display numbers from 1 to 10 using a
while loop.
2. Write a C program to generate the multiplication table of a
given number.
for Loop Homework:
1. Aim: Write a C program that prints the squares of the
first 10 numbers using a for loop.
2. Aim: Write a C program that prints all even numbers
between 2 and 20 using a for loop.
switch-case statement Homework:
3. Aim: Write a C program that takes a traffic light color as
input(R,G,Y) and displays the corresponding action
(STOP, GO, or WAIT) using a switch-case statement.

4. Aim: Write a C program that checks whether a given


character is a vowel or not using a switch-case
statement.

You might also like