6.4.. Napisati program koji za učitano x ispisuje vrijednost y po formuli: b) y = ax2 + bx + c.
Opis rješenja:
Opis programa:
Listing programa:
package zadatak;
import java.util.Scanner;
public class P06411133 {
public static void main(String[] args) {
Scanner input = new Scanner (System.in);
System.out.print("Unesi x: ");
double x=input.nextDouble();
System.out.print("Unesi a: ");
double a=input.nextDouble();
System.out.print("Unesi b: ");
double b=input.nextDouble();
System.out.print("Unesi c: ");
double c=input.nextDouble();
double y;
y = a*(x*x)+b*x+c;
System.out.println("y="+(y));
}}
Ispis na ekranu:
![](../../../pascal/pascal_prir/064/064_izvedi/06411133.gif)
Index
|