Write a program to find the Volume of a Triangular Prism.
Volume of a Triangular Prism Formula:
Volume =(1/2)*length * width * height
Input:
Output:
Volume of a Triangular Prism Formula:
Volume =(1/2)*length * width * height
Input:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #include <iostream.h> #include <conio.h> int main() { cout << " Volume of a Triangular Prism Formula: Volume =(1/2)*length * width * height \n"; float A, w, l, h, V, z; cout << "Enter the value of L <length>?\n"; cin >> l; cout << "Enter the value of W <Width>?\n"; cin >> w; cout << "Enter the value of h <height>?\n"; cin >> h; A = w * h; l = A * l; z = (1/2); V = l * z; cout <<"\t\"THE VOLUME OF Triangular Prism\" = "<< V << " m^3 " << endl; getch(); return 0; } |
Output:
Volume of a Triangular Prism Formula: Volume =(1/2)*length * width * height Enter the value of L <length>? 67 Enter the value of W <Width>? 45 Enter the value of h <height>? 56 "THE VOLUME OF a Triangular Prism" = 84420 m^3
No comments:
Post a Comment