draw a flowchart to accept three numbers. if the numbers are unequal then find the smallest number, otherwise print wrong input.
Answers
Answered by
1
Answer:
import java.util.Scanner;
public class KboatMinMaxNumbers
{
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
System.out.println("Enter 3 unequal numbers");
System.out.print("Enter first number: ");
int a = in.nextInt();
System.out.print("Enter second number: ");
int b = in.nextInt();
System.out.print("Enter third number: ");
int c = in.nextInt();
int min = a, max = a;
min = b < min ? b : min;
min = c < min ? c : min;
max = b > max ? b : max;
max = c > max ? c : max;
System.out.println("Greatest Number: " + max);
System.out.println("Smallest
Similar questions
English,
1 month ago
Math,
1 month ago
Chemistry,
1 month ago
English,
3 months ago
Social Sciences,
10 months ago
Computer Science,
10 months ago