0% found this document useful (0 votes)
2 views6 pages

Programming Problems

The document outlines a series of programming problems that involve basic input and output operations, including checks for positive/negative numbers, comparisons, and classifications based on age, grades, and other criteria. Each problem is accompanied by a sample output demonstrating the expected results. The problems range from simple arithmetic to more complex logic involving conditions and calculations.

Uploaded by

mariopomida2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views6 pages

Programming Problems

The document outlines a series of programming problems that involve basic input and output operations, including checks for positive/negative numbers, comparisons, and classifications based on age, grades, and other criteria. Each problem is accompanied by a sample output demonstrating the expected results. The problems range from simple arithmetic to more complex logic involving conditions and calculations.

Uploaded by

mariopomida2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

PROGRAMMING PROBLEMS

1. Check if a Number is Positive or Negative

Problem: Enter a number and check whether it's positive, negative, or zero.

Sample Output:

Enter a number: -10


The number is negative.

2. Find the Greater Number

Problem: Enter two numbers and display the greater one.

Sample Output:

Enter first number: 25


Enter second number: 18

The greater number is 25

3. Even or Odd

Problem: Enter a number and check if it is even or odd.

Sample Output:

Enter a number: 7
7 is an odd number.
4. Divisible by 5 and 3

Problem: Enter a number and check if it is divisible by both 5 and 3.

Sample Output:

Enter a number: 15
15 is divisible by both 5 and 3.

5. Age Group Classifier

Problem: Enter your age and determine your age group:

 0–12: Child
 13–19: Teen
 20 and above: Adult
Sample Output:

Enter your age: 17


You are a Teen.

6. Grade Equivalent

Problem: Enter a grade and display the remark:

 90–100: Excellent
 80–89: Good
 70–79: Fair
 Below 70: Poor
Sample Output:

Enter your grade: 82


Your remark is: Good
7. Number in Range (1 to 100)

Problem: Enter a number and check if it is within the range 1 to 100.

Sample Output:

Enter a number: 120


Number is not in range.

8. Simple Login Simulation

Problem: Simulate a login by checking if username is "admin" and password is "1234".

Sample Output:

Enter username: admin


Enter password: 1234
Login successful!

9. Smallest of Three Numbers

Problem: Enter three numbers and find the smallest one.

Sample Output:

Enter first number: 10


Enter second number: 7
Enter first number: 15

The smallest number is 7.

10. Check Leap Year

Problem: Enter a year and determine if it's a leap year.


Sample Output:

Enter a year: 2020


It is a leap year.
11. Largest Digit in a 3-digit Number

Problem: Enter a 3-digit number and display the largest digit.

Sample Output:

Enter a 3-digit number: 472


The largest digit is 7.

12. Temperature Checker

Problem: Enter the temperature and display a description:

 < 0: Freezing
 0–18: Cold
 19–30: Warm
 30: Hot
Sample Output:

Enter temperature: 35
The weather is Hot.

13. PHP to USD Converter

Problem: Convert Philippine Peso to USD (assume 1 USD = 58 PHP).


Sample Output:

Enter amount in PHP: 116


Equivalent in USD: 2

14. Sign and Parity Checker

Problem: Enter a number and check if it’s positive or negative and even or odd.
Sample Output:

Enter number: -8
Negative and even.
15. BMI Calculator (Simplified)

Problem: Enter weight (kg) and height (m), compute BMI, and display category:

 < 18.5: Underweight


 18.5–24.9: Normal
 25–29.9: Overweight
 30 and above: Obese

Sample Output:

Enter weight (kg): 60


Enter height (m): 1.65
BMI: 22.04
You are Normal weight.

16. Simple Calculator

Problem: Enter two numbers and an operator (+, -, *, /) then display the result.

Sample Output:

Enter first number:10


Enter second number:5
Enter operator (+ - * /): /
Result: 5

17. Pass or Fail

Problem: Enter a grade. If it is 75 or higher, display "You passed". Otherwise, "You failed."

Sample Output:

Enter your grade: 74


You failed.
18. First Digit Even or Odd

Problem: Enter a multi-digit number and determine if the first digit is even or odd.
Sample Output:

Enter a number: 4589


First digit: 4
It is even.

You might also like