20 Programs (Program Statement + Steps, No Logic)
20 Programs (Program Statement + Steps, No Logic)
1. Positive, Negative, or Zero
Program Statement: Write a program to check whether a number is positive, negative, or zero.
Steps:
-
Take integer input
n1
. -
Apply if–else if–else condition.
-
Print result.
2. Voting Eligibility
Program Statement: Write a program to check whether a person is eligible to vote.
Steps:
-
Take integer input
age
. -
Apply if–else condition.
-
Print result.
3. Even or Odd
Program Statement: Write a program to check whether a number is even or odd.
Steps:
-
Take integer input
n1
. -
Apply if–else condition.
-
Print result.
4. Vowel or Consonant
Program Statement: Write a program to check whether a character is a vowel or consonant.
Steps:
-
Take character input
ch
. -
Apply if–else condition.
-
Print result.
5. Leap Year
Program Statement: Write a program to check whether a year is a leap year.
Steps:
-
Take integer input
year
. -
Apply if–else if–else condition.
-
Print result.
6. Largest of Two Numbers
Program Statement: Write a program to find the largest of two numbers.
Steps:
-
Take two integer inputs
n1, n2
. -
Apply if–else condition.
-
Print result.
7. Smallest of Two Numbers
Program Statement: Write a program to find the smallest of two numbers.
Steps:
-
Take two integer inputs
n1, n2
. -
Apply if–else condition.
-
Print result.
8. Student Grade Classification
Program Statement: Write a program to assign grade based on student marks.
Steps:
-
Take integer input
marks
. -
Apply if–else if–else condition.
-
Print grade.
9. Divisible by 5 and 11
Program Statement: Write a program to check whether a number is divisible by 5 and 11.
Steps:
-
Take integer input
n1
. -
Apply if–else condition.
-
Print result.
10. Character Type Check
Program Statement: Write a program to check whether a character is uppercase, lowercase, digit, or special character.
Steps:
-
Take character input
ch
. -
Apply if–else if–else condition.
-
Print result.
11. Electricity Bill Calculation
Program Statement: Write a program to calculate electricity bill based on units consumed.
Steps:
-
Take double input
units
. -
Apply if–else if–else condition.
-
Print bill amount.
12. Triangle Type Check
Program Statement: Write a program to check type of triangle based on sides.
Steps:
-
Take three integer inputs
a, b, c
. -
Apply if–else if–else condition.
-
Print triangle type.
13. BMI Classification
Program Statement: Write a program to classify BMI as underweight, normal, overweight, or obese.
Steps:
-
Take double input
bmi
. -
Apply if–else if–else condition.
-
Print category.
14. Day Classification
Program Statement: Write a program to check if a given day number (1–7) is weekday or weekend.
Steps:
-
Take integer input
day
. -
Apply if–else if–else condition.
-
Print result.
15. Temperature Classification
Program Statement: Write a program to classify temperature.
Steps:
-
Take double input
temp
. -
Apply if–else if–else condition.
-
Print category.
16. Digit Count
Program Statement: Write a program to check if a number is single-digit, two-digit, or three-digit.
Steps:
-
Take integer input
n1
. -
Apply if–else if–else condition.
-
Print result.
17. Profit or Loss
Program Statement: Write a program to check profit, loss, or no profit-no loss.
Steps:
-
Take two double inputs
cp, sp
. -
Apply if–else if–else condition.
-
Print result.
18. Alphabet, Digit, or Special Character
Program Statement: Write a program to check whether a character is alphabet, digit, or special character.
Steps:
-
Take character input
ch
. -
Apply if–else if–else condition.
-
Print result.
19. Age Group Classification
Program Statement: Write a program to classify person as child, teenager, adult, or senior citizen.
Steps:
-
Take integer input
age
. -
Apply if–else if–else condition.
-
Print category.
20. Speed Classification
Program Statement: Write a program to classify speed as slow, average, fast, or very fast.
Steps:
-
Take double input
speed
. -
Apply if–else if–else condition.
-
Print result.
Comments
Post a Comment