8:00 pm - Thursday April 25, 2019

find Volume Area Of Cylinder

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044

/**
* Author: Candid Java Description: Program to Find The Volume Of Cylinder
*/

public class CylinderVolume {
public static void main(String[] args) {
float pi = 3.14f; // Assign The Pi Value
String s1 = args[0]; // Get The Radius As Input 1
String s2 = args[1]; // Get The Height As Input 2
int r = Integer.parseInt(s1); // Convert The String As Integer
int h = Integer.parseInt(s2);
int r_square = r * r; // Find The Square Of Radius
double Volume = pi * r_square * h; // Calculate The Volume Of Cylinder
System.out.println("Volume of Cylinder is: " + Volume); // Print The
// Output
}
}


Output:
 3 6
Volume of Cylinder is: 169.55999755859375
 2 7
Volume of Cylinder is: 87.92000579833984

Filed in: Z-A All Java Codes

Comments are closed.