Tuesday, 13 December 2016

Java Program to Find Area of Triangle With Output and Explanation

Problem:- Java program to find Area of Triangle with Output and Explanation or Java program to calculate area of Triangle or Java Program to Find the Area of a Triangle Given Three Sides or How to Calculate Area of Triangle in Java or How to calculate Area of Triangle through a Java program or Java Program To Calculate Area Of Right Triangle.

Explanation:- For finding the Area of Triangle we need to height and base of the triangle after that just put the height and base in given below formula, here you are done now the program will return the area of the triangle. We know that if the triangle is right angle than we can find the area of triangle by given formula show that

Formula:-

Area of Triangle = ( Height * Base ) / 2


Java Program to Find Area of Triangle With Output


See Also:- C Program To Display Area Of Triangle



Java Program to Find Area of Triangle With Output and Explanation



/* Program By Ghanendra Yadav
   Visit http://www.programmingwithbasics.com/
*/
import java.util.Scanner;
class trianglearea 
{
   public static void main(String args[]) 
   {   
      Scanner scanner = new Scanner(System.in);

      System.out.println("Enter the width of the Triangle:");
      double base = scanner.nextDouble();

      System.out.println("Enter the height of the Triangle:");
      double height = scanner.nextDouble();

      double area = (base* height)/2;
      System.out.println("Area of Triangle is: " + area);      
   }
}


See Also:- C++ Program To Display Area Of Triangle

Output:-


Java Program to Find Area of Triangle With Output



You May Also See

Extreme Recommended:- Like our Facebook Page or Join our Facebook Group and Google plus Community for up-to-date. If you have any Query or Question you can ask in the group, I will Try To Solve your Query and try to answers of your Questions withing 24 Hours, You can also Email me or comment below Please suggest to your Friends to join and like our page and don't forget to Subscribe. Enter your Email and click to subscribe.

Ghanendra Yadav

Ghanendra Yadav

Hello, I Am Ghanendra Yadav Owner of This Blog, I am professional Blogger and Programmer. I Love Programming, Logo Making, And Banner Designing. My Highest Qualification is MCA From NIT Warangal. You Can Find Me On Social Media Through Below Link And If You Have Any Query Related To Programming And Other Subject Comment Below or You Can Mail Me I Will Try To Answer Within 24 Hours Email:- yghanendra@student.nitw.ac.in

Find me on Social Media

Facebook | Twitter | Google+ | RSS Feed

No comments:

Post a Comment