⇧
Contact Us
||
Privacy Policy
||
About Us
Home
Java
Progarm
PHP
Menu ▼
Program
Vowel or Constant
Area of Circle
Find the Triangle
Compound Interest
Prime Number
Reverse Number
Factorial Number
Sum of Element
User Input
Calculate Average
Even or Odd
N Prime Number
1 to n Prime Number
Reverse String
Reverse String by User
Check Leap Year
HexaDecimal String
Binary to Decimal
Get IP
Check ArmStrong
ArmStrong Or Not
next →
← prev
3) Write a program to find the Area of Triangle.
Program
import java.util.Scanner; class AreaOfTriangle { public static void main(String args[]) { Scanner s= new Scanner(System.in); System.out.println("Enter the width of the Triangle:"); double b= s.nextDouble(); System.out.println("Enter the height of the Triangle:"); double h= s.nextDouble(); //Area = (width*height)/2 double area=(b*h)/2; System.out.println("Area of Triangle is: " + area); } }
Next Topic
← prev
next →