Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

Write a program to determine whether a given number is even or odd.

Create a program to check if a given year is a leap year.


Write a program to determine if a given number is prime.
Create a program that checks if a given number is positive, negative, or zero.
Write a program that determines if a given character is a vowel or consonant.
Create a program to calculate the roots of a quadratic equation.
Write a program that determines the largest of three numbers.
Create a program that checks if a given string is a palindrome.
Write a program to find the factorial of a given number.
Create a program that checks if a given number is a perfect square.
Write a program to calculate the sum of digits of a given number.
Create a program that checks if a given string is an anagram of another string.
Write a program that determines the day of the week for a given date.
Create a program to calculate the area of a triangle given its sides.
Write a program that determines if a given number is a Fibonacci number.
Create a program to convert temperature from Celsius to Fahrenheit or vice versa.
Write a program that determines if a given string is a pangram.
Create a program that checks if a given number is a perfect number.
Write a program to find the largest prime factor of a given number.
Create a program that determines if a given number is a palindrome.
Write a program to check if a given number is divisible by both 5 and 11.
Create a program that checks if a given string is a valid email address.
Write a program to check if a given number is a power of 2.
Create a program that determines the area and perimeter of a rectangle.
Write a program to find the GCD (Greatest Common Divisor) of two numbers.
Create a program that checks if a given string is a valid URL.
Write a program to check if a given number is a Harshad number.
Create a program that determines if a given year is a leap year.
Write a program to determine if a given number is abundant, deficient, or perfect.
Create a program that checks if a given string is a valid IP address.
Write a program to find the sum of all prime numbers between two given numbers.
Create a program that determines if a given number is a narcissistic number.
Write a program to find the missing number in a given array of integers.
Create a program that checks if a given string is a valid palindrome sentence.
Write a program to determine if a given number is a Kaprekar number.
Create a program that checks if a given string is a valid JSON.
Write a program to find the sum of digits of a given number until it becomes a single-
digit number.
Create a program that determines if a given number is an Armstrong number.
Write a program to check if a given string is a valid IPv4 address.
Create a program that checks if a given number is a Smith number.
Write a program to determine if a given number is a Duck number.
Create a program that checks if a given string is a valid IPv6 address.
Write a program to find the smallest missing positive integer in a given array.
Create a program that determines if a given number is a palindrome in binary
representation.
Write a program to check if a given string is a valid credit card number.
Create a program that checks if a given number is a Catalan number.
Write a program to determine if a given string is a valid XML.
Create a program that checks if a given number is a happy number.
Write a program to check if a given string is a valid hexadecimal number.
Create a program that determines if a given number is a narcissistic number.
Write a program to determine whether a given number is even or odd.

Create a program to check if a given year is a leap year.

Create a program that checks if a given number is positive, negative, or zero.

Write a program that determines the largest of three numbers.

If a student's score is above 90, print "Excellent", else if it's above 80, print "Very Good",
else print "Good".
If a number is positive, print "Positive", else if it's negative, print "Negative", else print
"Zero".

If a person's age is less than 18, print "Minor", else if it's between 18 and 65, print
"Adult", else print "Senior".

If a student's grade is 'A', print "Excellent", else if it's 'B', print "Good", else if it's 'C', print
"Average", else print "Below Average".

If a temperature is above 30°C, print "Hot", else if it's between 20°C and 30°C, print
"Warm", else print "Cold".

If a product's price is above ₱100, print "Expensive", else print "Affordable".


If a user's role is 'admin', grant full access, else if it's 'moderator', grant limited access,
else grant guest access.
If a person's BMI is less than 18.5, print "Underweight", else if it's between 18.5 and
24.9, print "Normal weight", else if it's between 25 and 29.9, print "Overweight", else
print "Obese".
If a fruit is an apple, print "It's an apple", else if it's a banana, print "It's a banana", else if
it's an orange, print "It's an orange", else print "It's a fruit".

If a number is even, print "Even", else print "Odd".

If a vehicle's fuel level is less than 25%, print "Low fuel", else if it's between 25% and
50%, print "Moderate fuel", else print "Sufficient fuel".
If a student's attendance is less than 75%, print "Warning", else if it's between 75% and
90%, print "Satisfactory", else print "Excellent".
If a country's population is above 100 million, print "High population", else print "Low
population".
If a movie is rated 'PG', print "Suitable for all ages", else if it's rated 'PG-13', print
"Parental guidance suggested", else print "Adults only".
If a person's salary is less than $1000, print "Low income", else if it's between $1000
and $5000, print "Moderate income", else print "High income".
If a day is a weekend, print "It's a weekend", else print "It's a weekday".
If a country has a GDP growth rate above 5%, print "High growth", else if it's between
2% and 5%, print "Moderate growth", else print "Low growth".
If a person's blood pressure is less than 120/80, print "Normal", else if it's between
120/80 and 139/89, print "Prehypertension", else print "Hypertension".
If a student's rank is below 100, print "Top 100", else print "Beyond top 100".
If a coupon is expired, print "Expired", else if it's about to expire in less than a week,
print "Expiring soon", else print "Valid".
If a city's crime rate is above 50%, print "High crime rate", else if it's between 25% and
50%, print "Moderate crime rate", else print "Low crime rate".
If a dish contains meat, print "Non-vegetarian", else print "Vegetarian".
If a person's shoe size is above 10, print "Large size", else if it's between 8 and 10, print
"Medium size", else print "Small size".
If a student's GPA is above 3.5, print "Honors", else if it's between 3.0 and 3.5, print
"High distinction", else if it's between 2.5 and 3.0, print "Distinction", else print "Pass".
If a room's temperature is above 25°C and the humidity is above 60%, print "Hot and
humid", else if it's above 25°C, print "Hot", else if it's below 15°C, print "Cold", else print
"Comfortable".
If a package weighs more than 10 kg, print "Heavy", else if it's between 5 kg and 10 kg,
print "Moderate", else print

Weather Forecast: If the temperature is above 80°F, print "It's a hot day"; otherwise,
print "Enjoy the weather."

Grading System: If the score is above 90, print "A"; if it's between 80 and 90, print "B";
else print "C."

Age Verification: If the user is above 18 years old, allow access; otherwise, display a
message "Access denied."

Discount Calculator: If the purchase amount is over $100, apply a 10% discount;
otherwise, no discount is applied.

Traffic Light: If the light is green, print "Go"; if it's yellow, print "Slow down"; if it's red,
print "Stop."

Ticket Pricing: If the age is under 12, the ticket price is $5; if it's between 12 and 18, the
price is $10; otherwise, it's $15.

Banking App: If the balance is below $1000, display a message "Low balance";
otherwise, "Sufficient balance."
Meal Selection: If the user picks "pizza," display a message "Enjoy your pizza";
otherwise, "Bon appétit!"

Movie Ratings: If the rating is 5 stars, print "Excellent"; if it's 4 stars, print "Very Good"; if
it's 3 stars, print "Good"; otherwise, "Fair."

Password Validation: If the password contains at least 8 characters, including letters,


numbers, and special characters, accept it; otherwise, display "Password is weak."

Library Membership: If the user is a student, grant access to borrow books; otherwise,
only allow browsing.

Phone Charger: If the phone battery is below 20%, display "Low battery"; otherwise,
"Battery is sufficient."

Movie Ticket Booking: If the user selects a showtime after 6 PM, apply a $5 evening
surcharge; otherwise, no surcharge is applied.

Hotel Booking: If the number of guests exceeds the room capacity, display "Room full";
otherwise, "Room available."

Student Eligibility: If the student has passed all subjects, print "Eligible for promotion";
otherwise, "Reappear for failed subjects."

Credit Card Approval: If the user's credit score is above 700, approve the credit card
application; otherwise, reject it.

Game Levels: If the player reaches level 10, display "Congratulations, you've reached
the final level"; otherwise, "Keep playing to unlock more levels."

Job Application Screening: If the applicant meets all qualifications, schedule an


interview; otherwise, reject the application.
Restaurant Menu: If the user selects a vegetarian dish, display "Enjoy your vegetarian
meal"; otherwise, "Bon appétit!"

Car Rental: If the user's age is below 25, apply a young driver surcharge; otherwise, no
surcharge is applied.

Flight Booking: If the departure time is within 3 hours, display "Check-in now";
otherwise, "Check-in opens 3 hours before departure."

Temperature Control: If the room temperature is above 75°F, activate the air conditioner;
otherwise, no action is needed.

Fitness App: If the user's step count exceeds 10,000, display "Great job"; otherwise,
"Keep moving!"

Online Shopping: If the item is out of stock, display "Item not available"; otherwise, "Add
to cart."

Pet Adoption: If the user selects a puppy, display "Congratulations on your new furry
friend"; otherwise, "Browse other pets."

Voting Eligibility: If the user's age is above 18 and citizenship status is "citizen," grant
voting rights; otherwise, "Not eligible to vote."

Product Warranty: If the purchase date is within a year, display "Warranty active";
otherwise, "Warranty expired."

Meeting Schedule: If the meeting time overlaps with another appointment, display
"Schedule conflict"; otherwise, "Meeting confirmed."
Credit Limit: If the user's credit utilization ratio is below 30%, increase the credit limit;
otherwise, maintain the current limit.

Restaurant Reservation: If the reservation time is during peak hours, display "Limited
availability"; otherwise, "Reservation confirmed."

Health Insurance Coverage: If the user's annual premium payment is up-to-date,


provide coverage; otherwise, "Coverage suspended."

Bus Fare: If the user is a senior citizen, apply a 50% discount on the fare; otherwise, no
discount is applied.

Parcel Delivery: If the delivery address is within the service area, proceed with delivery;
otherwise, "Out of service area."

Event Registration: If the registration deadline has passed, display "Registration


closed"; otherwise, "Register now."

Temperature Warning: If the weather forecast predicts temperatures below freezing,


display "Extreme cold warning"; otherwise, "No weather alerts."

Online Course Enrollment: If the course prerequisites are met, allow enrollment;
otherwise, "Pre-requisites not fulfilled."

Hotel Check-in: If the check-in time is after 3 PM, display "Check-in time reached";
otherwise, "Check-in opens at 3 PM."

Flight Status: If the flight is delayed by more than 2 hours, display "Flight delayed";
otherwise, "On-time departure."

Library Book Return: If the book is overdue, display "Late return fee applicable";
otherwise, "Book returned successfully."
Gym Membership Renewal: If the membership has expired, display "Renew
membership"; otherwise, "Membership active."

Food Delivery: If the delivery address is within the delivery radius, proceed with the
order; otherwise, "Out of delivery range."

Credit Card Payment: If the minimum payment is made, display "Payment received";
otherwise, "Minimum payment required."

Online Auction: If the bid amount exceeds the reserve price, display "Bid accepted";
otherwise, "Bid too low."

Gardening Tips: If the soil moisture is low, display "Water the plants"; otherwise, "No
need to water."

Discount Voucher: If the voucher code is valid, apply the discount; otherwise, "Invalid
voucher code."

Flight Upgrade: If the user selects a premium seat, display "Upgrade to premium class";
otherwise, "Economy class booked."

Package Tracking: If the package is out for delivery, display "Expected delivery today";
otherwise, "In transit."

Insurance Claim: If the claim documentation is complete, process the claim; otherwise,
"Incomplete documentation."

Parking Permit: If the parking permit is valid, display "Parking allowed"; otherwise, "No
parking permit."
Internet Connectivity: If the internet connection is unstable, display "Connection lost";
otherwise, "Connected to the internet."

You might also like