12:20 am - Tuesday May 22, 2018

Java Example Program to compute Area of Triangle

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
/*To find the area of triangle*/
/**
*@author:Candidjava.com
*@Description:To calculate area of trianlge
*/
public class Area
{
public static void main(String[] args)
{
int area;
int breath=12;
int height=20;

area=(breath*height)/2;// use this line if find the area of triangle
System.out.println("area:"+area);// use this line display the value area
}
}

output:

area:120

Filed in: Sample Programs in java

Comments are closed.