6.4.. Napisati program koji izračunava i ispisuje rezultate:
1 + 7 MOD 3 * (2 + 7) DIV 2
(1 + 7) MOD 3 * 2 + 7 DIV 2

Opis rješenja:

Opis programa:

Listing programa:

package Zadatak;
import java.util.Scanner;
public class P06411128 {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);

		int x, y;

		x = 1 + (7 % 3) * (2 + 7) / 2;
		y = (1 + 7) % 3 * 2 + 7 / 2;

		System.out.println("X = " + x);
		System.out.print("y = " + y);
	}
}

Ispis na ekranu:

Index