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.