filmov
tv
Calculate the Area of a Triangle in JavaScript || JS Program for Beginners in 2022

Показать описание
Welcome To Code Bengali Channel we will see Calculate the Area of a Triangle
Area When Base and Height is Known
const baseValue = prompt('Enter the base of a triangle: ');
const heightValue = prompt('Enter the height of a triangle: ');
// calculate the area
const areaValue = (baseValue * heightValue) / 2;
`The area of the triangle is ${areaValue}`
);
Output
Enter the base of a triangle: 4
Enter the height of a triangle: 6
The area of the triangle is 12
***************** Must Watch Video ******************
***************** React JS Tutorial ******************
***************** Node JS Tutorial ******************
Please support my channel by SUBSCRIBE to my channel and share my videos in your Social Network.
Area When Base and Height is Known
const baseValue = prompt('Enter the base of a triangle: ');
const heightValue = prompt('Enter the height of a triangle: ');
// calculate the area
const areaValue = (baseValue * heightValue) / 2;
`The area of the triangle is ${areaValue}`
);
Output
Enter the base of a triangle: 4
Enter the height of a triangle: 6
The area of the triangle is 12
***************** Must Watch Video ******************
***************** React JS Tutorial ******************
***************** Node JS Tutorial ******************
Please support my channel by SUBSCRIBE to my channel and share my videos in your Social Network.