6.4.. Napisati program za izrańćunavanje izraza: 2x, a / 3

Listing programa :

// Izrazi: 2x, a / 3
package zadatak;
import java.util.Scanner;
public class P06411022 {
	public static void main(String[] args)	{
	Scanner input = new Scanner (System.in);
	
	System.out.println("Izrazi: 2x, a / 3");
	System.out.print("Brojevi x i a: ");	
	double x = input.nextDouble ();
	double a = input.nextDouble ();
	System.out.println("Rezultati:  2*x= " +2*x+ "   a/3 = " +a/3 );
	}
}

Ispis na ekranu:

Index