- 1
Give coding to find the area of triangle
give programing
5 Réponses
+ 1
The area if a Triangle is
Area=1/2 * h * b
All you have to do is get height and base. The plug them into the formula.
import java.util.Scanner;
public class Program
{
public static void main(String[] args) {
double h, b, area;
Scanner scan=new Scanner(System.in);
h=scan.nextInt();
b=scan.nextInt();
area=.5 * (h*b);
System.out.println(area);
}
}
+ 1
Int sideA, sideB, sideC;
Cout<<"ENTER the lengths of each side:";
cin<<sideA<<sideB<<sideC;
cout<<"The Area is: << (sideA * sideB * sideC)<<endl;
hope you understand.
0
can u plz help me in giving the coding of area of a rectangle
0
I did. the code is there. the entire program is written. I also gave you the formula to figure out area of a Triangle. I don't know what else you want.
- 1
thank u so much plz can u give me the programing of the area of a rectangle