class trianglearea
{
public static void main(String args[])
{
int a,b,c;
double s,area;
a=Integer.parseInt(args[0]);
b=Integer.parseInt(args[1]);
c=Integer.parseInt(args[2]);
s=(a+b+c)/2.0;
System.out.println(s);
area=Math.sqrt(s*(s-a)*(s-b)*(s-c));
System.out.println("Area =" + area);
}
}
The applied calculation method is shown underneath.
{
public static void main(String args[])
{
int a,b,c;
double s,area;
a=Integer.parseInt(args[0]);
b=Integer.parseInt(args[1]);
c=Integer.parseInt(args[2]);
s=(a+b+c)/2.0;
System.out.println(s);
area=Math.sqrt(s*(s-a)*(s-b)*(s-c));
System.out.println("Area =" + area);
}
}
The applied calculation method is shown underneath.
No comments:
Post a Comment