-
Write a program in java to evaluate and print the value of mathematical function: f(x,y) = 2x2 - y + 3
almost 8 years ago
-
almost 8 years ago
Hi Mark,
You can write a separate function and call that function from your main method as below:
public class CalculateFun { public static void main(String[] args) { double x = 3.0; double y = 3.0; double z = f(x, y); System.out.println(z); } private static double f(double x, double y) { return 2 * x * x - y + 3; } }
Hope this will help you:)
-
1 Answer(s)