Computer Science, asked by minecraftgamer071220, 4 months ago

Write a program that accepts numbers from the user till the user enters zero. Find out the

maximum and minimum number entered and display the result.​

Answers

Answered by rp2487191gmailcom
0

Answer:

sorry iska uttar nahi pta h

Answered by crpiyushbansal
1

Answer:

package com.company;

import javax.swing.text.html.MinimalHTMLWriter;

import java.util.Scanner;

public class max_min {

   public static void main(String[] args) {

       Scanner sc = new Scanner(System.in);

       int num;

       int max;

       int min;

       char c;

       max = Integer.MIN_VALUE;;

       min=Integer.MAX_VALUE;;

       do {

           System.out.println("ENTER ANY NUMBER");

           num = sc.nextInt();

           if (num > max) {

               max = num;

           }

           if (num < min) {

               min = num;

           }

           System.out.println("DO YOU WANT TO CONTINUE ?");

           c=sc.next().charAt(0);

       }while (c == 'y' || c== 'Y');

       System.out.println(max);

       System.out.println(min);

   }

}

Explanation:

Similar questions