Home » JAVA Programming » Basic Datatypes » Question
  1. What is the output of this program?

    class area {
    public static void main(String args[])
    {
    double r, pi, a;
    r = 6.8;
    pi = 3.14;
    a = pi * r * r;
    System.out.println(a);
    }
    }
    1. 142.1935
    2. 145.1936
    3. 140.236
    4. 145.2936
    5. 145
Correct Option: B

here area : a = 6.8 * 6.8 * 3.14
output: 145.1936



Your comments will be displayed only after manual approval.