-
What is the output of this program?
public class dynamic_initialize
{
public static void main(String args[])
{
double p, q;
p = 4.5;
q = 10.0;
double r = Math.sqrt(p * p + q * q);
System.out.println(r);
}
}
-
- 11.965
- 10.965
- 10.965856099730654
- 12.965
- 10.865856099730654
Correct Option: C
Variable c has been dynamically initialized to square root of a * a + b * b, during run time.
output: 10.965856099730654