Control Statements Conditional
58 programs in this topic — each includes source code, sample output and explanation.
-
Check Positive Number
This program checks if a number is positive using an if statement.
-
Check Negative Number
This program checks if a number is negative using an if statement.
-
Check Even or Odd
This program checks if a number is even or odd using if-else.
-
Check Greater of Two Numbers
This program finds the greater of two numbers using if-else.
-
Check Age for Voting
This program checks if a person is eligible to vote.
-
Check Grade Based on Marks
This program assigns grades based on marks using if-else ladder.
-
Check Day Type (Weekday/Weekend)
This program checks if a day is weekday or weekend.
-
Check Month Name
This program prints the month name based on a given number using switch.
-
Check Grade Using Switch
This program prints grade description based on grade character using switch.
-
Check Largest of Two Numbers
This program finds the largest of two numbers using nested if.
-
Check Largest of Three Numbers
This program finds the largest of three numbers using nested if.
-
Check Leap Year
This program checks if a year is a leap year using multiple conditions.
-
Check Number Sign
This program checks if a number is positive, negative, or zero.
-
Check Eligibility for Scholarship
This program checks eligibility for scholarship based on marks and income.
-
Check Leap Year with Nested If
This program checks if a year is a leap year using nested if statements.
-
Check Largest of Four Numbers
This program finds the largest of four numbers using if-else ladder.
-
Check Pass or Fail
This program checks if a student has passed or failed based on marks.
-
Check Arithmetic Operation
This program performs arithmetic operations based on user choice using switch.
-
Check Course and Subject
This program uses nested switch to print subject names based on course selection.
-
Check Grading System with Ranges
This program assigns grades based on marks ranges.
-
Check Loan Eligibility
This program checks loan eligibility based on income and credit score.
-
Check BMI Category
This program checks BMI category based on BMI value.
-
Check Driving Eligibility
This program checks driving eligibility based on age and license status.
-
Check Season by Month
This program prints the season name based on month number using a switch statement.
-
Check Admission Eligibility
This program checks admission eligibility based on marks and entrance exam score.
-
Check Electricity Bill Slab
This program calculates electricity bill based on units consumed using if-else ladder.
-
Check Employee Department
This program prints department name based on department code using switch.
-
Check Discount Eligibility
This program checks discount eligibility based on purchase amount and membership status.
-
Income Tax Calculation
This program calculates tax based on income slabs using if-else ladder.
-
Check Scholarship Eligibility
This program checks scholarship eligibility based on marks and extracurricular activities.
-
Menu-Driven Calculator
This program performs arithmetic operations based on menu choice using switch.
-
Check Job Eligibility
This program checks job eligibility based on age, qualification, and experience.
-
Check Tax Category
This program categorizes taxpayers based on income.
-
Check Exam Eligibility
This program checks exam eligibility based on attendance and marks using nested if.
-
Refined Tax Category
This program refines tax categories into more detailed ranges.
-
Menu-Driven Food Ordering System
This program simulates a food ordering system using switch.
-
Check Insurance Eligibility
This program checks insurance eligibility based on age, health status, and income.
-
Check Travel Eligibility
This program checks travel eligibility based on passport and visa status.
-
ATM Withdrawal Check
This program checks if withdrawal is possible based on balance.
-
Online Shopping Discount
This program checks discount eligibility based on purchase amount and membership.
-
Exam Grading System
This program assigns grades based on marks using if-else ladder.
-
ATM PIN Verification
This program checks ATM PIN and withdrawal eligibility using nested if.
-
Banking Menu System
This program simulates a banking menu system using switch.
-
Check Loan Approval
This program checks loan approval based on income, credit score, and employment status.
-
ATM Transaction Options
This program simulates ATM transaction options using if-else ladder.
-
Online Shopping Menu
This program simulates an online shopping menu using switch.
-
Exam Result Classification
This program classifies exam results based on marks and attendance using nested if.
-
Nested Menu-Driven Application
This program simulates a nested menu-driven application using nested switch.
-
ATM Balance Inquiry
This program checks and prints account balance.
-
ATM Withdrawal with PIN
This program checks PIN and withdrawal eligibility.
-
Online Shopping Categories
This program simulates online shopping categories.
-
Exam Result Classification
This program classifies exam results based on marks.
-
Online Shopping Discount with Membership
This program checks discount eligibility based on purchase and membership.
-
Exam Grade Switch
This program assigns grades based on grade character using switch.
-
Tax Slab Calculation
This program calculates tax based on income slabs.
-
Loan Eligibility Check
This program checks loan eligibility based on income and credit score using nested if.
-
University Course Selection
This program prints course name based on course code using switch.
-
Travel Eligibility Check
This program checks travel eligibility based on passport, visa, and ticket status.