Print statement isn't executed

This is my code:


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		System.out.print("enter numbers:\n");
		float eingabe = sc.nextFloat();
		float summe = 0;
		float min = eingabe;
		float max = eingabe;
		int zaehler = 0;
		float mittel = summe / zaehler;
		if (eingabe < 1) {
			System.out.print("no number entered.\n");
			sc.close();
		} else {
			while (eingabe > 0) {
				if (eingabe < min) {
					min = eingabe;
				} else if (eingabe > max) {
					max = eingabe;
				}
				summe = summe + eingabe;
				zaehler++;
			}
			sc.close();
			System.out.printf("numbers entered: %d\nminimum: %.2d\nmaximum: %.2d\nmean:    %.2d", zaehler, min, max, mittel);
		}
	}
}

You can also run it and enter values here.

Here’s what it should achieve:

Write a program LoopStatistics. Main that reads values on the console and outputs some
statistical quantities of the entered set of numbers afterwards. If no positive number is entered, the
program prints no number entered.
The user can enter as many positive floating-point numbers on the console as desired. Zero (or a
negative numbers) signals end of input (no more numbers can be entered). After input the program
displays
• the smallest number entered (min)
• the largest number entered (max)
• the mean of all numbers entered (mean)
Do NOT use arrays for this assignment, even if you know them.

Console Example for desired output:

enter numbers:
1 2 3 4 5 6 0
numbers entered: 6
minimum: 1.00
maximum: 6.00
mean:    3.50
enter numbers:
0
no number entered.

As you can see, entering the numbers in my code kinda does nothing :thinking:

The above code is not under link I posted there anymore, instead I’ve made two new variants:
do/while-loop:

for-loop:

None is working properly! :cry: