Task 1
Question #1: Write a C++ program that takes an integer as input and checks whether the number
is positive, negative, or zero using if–else.
Question #2: Write a C++ program to input a number and determine whether it is even or odd
using an if–else statement.
Question #3: Write a C++ program that takes two numbers from the user and displays the larger
number using if–else.
Question #4: Write a C++ program that inputs a person’s age. If the age is 18 or above, display
“Eligible to Vote”, otherwise display “Not Eligible to Vote” using if–else.
Question #5: Write a C++ program that takes a character as input and checks whether it is a
vowel or a consonant using if–else.
Question #6:
Write a C++ program to input a number and check whether it is divisible by 5 or not using if–
else.
Question #7:
Write a C++ program to input a year and check whether it is a leap year using if–else.
Question #8:
Write a C++ program to input a character and check whether it is an uppercase letter or
lowercase letter using if–else.
Question #09:
Write a C++ program to input a temperature in Celsius and display whether it is Freezing,
Normal, or Hot using if–else.
Question #10:
Write a C++ program to input three numbers and find the smallest number using nested if–else.
Question #11:
Write a C++ program to input a number and check whether it is a two-digit number or not.
Question #12:
Write a C++ program to input basic salary and calculate gross salary according to:
If basic ≤ 20,000 → HRA = 20%, DA = 80%
If basic > 20,000 → HRA = 30%, DA = 90%
Question #13:
Write a C++ program to input a character and check whether it is a digit or alphabet.
Question #14:
Write a C++ program to input total classes held and classes attended and check whether a student
is allowed to sit in exam (attendance ≥ 75%).
Question #15:
Write a C++ program to input time in hours and display Good Morning, Good Afternoon, or
Good Evening using if–else.