Anyone know why i am getting a 1e0.002 when i input a number to find the area?
#include <iostream> #include <iomanip> using namespace std; int main() { float length, height, area, base, VP ; cout << "The volume of the square base pyramid." << endl; cout << "Enter the length of the pyramid's base :" << endl; cin >> length ; cout << "Enter the height of the pryamid :" << endl; cin >> height ; area = length*length ; VP = (area*height)/3 ; cout <<setprecision (2) << "The area of the base is : " << area << endl;; cout <<setprecision(2) << "The height of the pyramid is : " << height<< endl ; cout << setprecision (2) <<"The volume of the pyramid is : " << VP << endl; system ("pause") ; }
Join our real-time social learning platform and learn together with your friends!