package positivenegativecount; import java.util.Scanner; public class PositiveNegativeCount { /** * @param args the command line arguments */ public static void main(String[] args) { Scanner input = new Scanner(System.in); int positiveCount = 0, negativeCount = 0; for (int i = 1; i <= 5; i++) { System.out.print("Enter number " + i + ": "); int num = input.nextInt(); if (num > 0) { positiveCount++; } else if (num < 0) { negativeCount++; } } System.out.println("Positive: " + positiveCount); System.out.println("Negative: " + negativeCount); } }