C++ Program to calculate the volume and surface of the prisms. | सी ++ प्रोग्राम की मात्रा और प्रिज्म की सतह की गणना करने के लिए।

C++ Program to calculate the volume and surface of the prisms.

Let see the program to calculate the volume and surface of the prisms.

Example:
  1. Formula:

    Volume of prisms and surface of prisms
    Prisms

/* to calculate the volume of the prisms. */ #include <iostream> using namespace std; int main() { double base,height,volume; cout<<"Enter base of prisms :"; cin>>base; cout<<"Enter height of prisms :"; cin>>height; volume=base*height; cout<<"Volume of prisms = :"<<volume<<" units."<<endl; return 0; }
Output:
Enter base of prisms :10 Enter height of prisms :15 Volume of prisms = :150 units.
/* to calculate the surface of the prisms. */ #include <iostream> using namespace std; int main() { double base,height,base_perimeter,surface; cout<<"Enter base of prisms :"; cin>>base; cout<<"Enter height of prisms :"; cin>>height; cout<<"Enter base perimeter of prisms :"; cin>>base_perimeter; surface=2*base+base_perimeter*height; cout<<"surface of prisms = :"<<surface<<" sq. units."<<endl; return 0; }
Output:
Enter base of prisms :1 Enter height of prisms :2 Enter base perimeter of prisms :3 surface of prisms = :8 sq. units.