Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/purvgwtw/public_html/tutorials/common.php on line 7
Java determine the circumference of a circle
Sponsered Links
Categories
Sponsered Links

Java determine the circumference of a circle

Here we are going to find the circumference of a circle.

import java.util.*;
class Circumference{

final static double pi=3.14;
public static double circum(double r){
    return 2*pi*r;
}
public static void main(String[]args){
Scanner input=new Scanner(System.in);
System.out.println("Enter radius: ");
double r=input.nextDouble();
double circumferenceOfCircle=Circumference.circum(r);
System.out.println("Circumference of  Circle: "+circumferenceOfCircle);
}
}

Sponsered Links
Latest Updates
 
All Content of this site is for learning only. We do not warrant the correctness of its content. The risk from using it lies entirely with the user. While using this site, you agree to have read and accepted our terms of use and privacy policy.
Copyright © 2014 PURVACOMPUTERS.COM All Right Reserved