Warning
This page is located in archive.

2. cvičení

Příklad

Napište program který spočítá aritmetický průměr z pěti čísel

public static void main(String[] args) {
        int a,b,c,d,e;
        double p;
 
        a = 2;
        b = 2;
        c = 2;
        d = 2;
        e = 3;
 
        p = (double) (a+b+c+d+e)/5;
 
        System.out.println("Prumer je " + p);
    }

courses/a0b36pri/teacher/havlicr/cv2.txt · Last modified: 2015/10/14 17:35 by havlicr