Heyy friendss!!
Please help me with my program...below!
nd tell me what is the correction.. I'm always getting the area as 0 ... so help me!
Thanxx!
class heron
{
public static void main(String args[])
{
int a=6,b=4,c=10;
int s= (a+b+c) / 2;
double area = Math.sqrt(s*(s-a) * (s-b) * (s-c));
System.out.println("Program to calculate the Area of a Triangle using Heron's Formula");
System.out.println(" ");
System.out.println("The First side of the Triangle is " +a);
System.out.println("The Second side of the Triangle is "+b);
System.out.println("The Third side of the Triangle is " +c);
System.out.println("The Area of the Triangle is " + area);
}
}
