005-001-010

if Statement: Positive Number Check

Easy

Problem Description

if statement: Positive Number Check

In this problem, you will create a program that reads one integer, uses an if statement to determine whether the value is positive (greater than 0), and displays "Positive" to standard output only when the condition is met.

Learning Objective: Understand how to use if statements for simple conditional branching

Overview

Create a program that receives one integer as input and outputs "Positive" if the number is positive (greater than 0). If 0 or less, output nothing.

Specifications

  • Read one integer
  • Output "Positive" only if the value is greater than 0
  • Output nothing if 0 or less

Input Format

5

Output Format

Positive

Note

  • If input is 5 → Output "Positive"
  • If input is 0 → Output nothing
  • If input is -3 → Output nothing

Ready to Try Running Code?

Log in to access the code editor and execute your solutions for this problem.

Don't have an account?

Sign Up