Question: (b) Write a C program that calculates the Surface Area of a Square Based Pyramid. The user will input the height of the Pyramid

(b) Write a C program that calculates the Surface Area of a 

(b) Write a C program that calculates the Surface Area of a Square Based Pyramid. The user will input the height of the Pyramid and the length of one of the square sides from the keyboard in that order. The Surface Area is given by this formula: Surface Area = (length x length) + 2 x length x [ (height x height) + (length x length) ] Your code should check that the values entered are valid and produce the following example output: Height of Pyramid is 32.4m Length of Pyramid is 23.0m Surface Area of Square Based Pyramid is 2357 square meters [10 Marks]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres a C program that calculates the surface area of a squarebased ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!