InLab02 Solution

InLab02 Solution - // Standard Set #2...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 import java.util.Scanner public class InLab02 { public static void main(String args[]) { Scanner scanner = new Scanner(System.in) // Standard Set #1 System.out.print("Enter a number: ") int num = scanner.nextInt() System.out.println("Your number is between -10 and 10.") else System.out.println("Your number is not between -10 and 10.")
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: // Standard Set #2 System.out.print("Enter the first nonzero number: ") int num1 = scanner.nextInt() System.out.print("Enter the second nonzero number: ") int num2 = scanner.nextInt() if (num1 * num2 > 0) System.out.println("Both numbers have the same sign.") else System.out.println("Each number has a different sign.") } }...
View Full Document

Ask a homework question - tutors are online