6.4.. Izračunati sumu kubova dva učitana broja.
Listing programa:
//
package zadatak;
import java.util.Scanner;
public class P06411139 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Unesi prvi broj: ");
double a = input.nextDouble();
System.out.print("Unesi drugi broj: ");
double b = input.nextDouble();
double c = Math.pow(a, 3);
double d = Math.pow(b, 3);
double e = c + d;
System.out.print("Suma njihovih kubova je: " + e);
}
}
Ispis na ekranu:
![](../../../pascal/pascal_prir/064/064_izvedi/06411139.gif)
Index
|