Question: How to round up the answer to 3 significant figure in c programming language?IE 1 0 0 5 AY 2 3 / 2 4 Special

How to round up the answer to 3 significant figure in c programming language?IE1005 AY23/24 Special Terms
Practical Exercise Assessment 1
Write a C program that takes two positive real numbers from the user as the base edge, a, and height, h, of a right square pyramid. See Figure 1. The program should then print on the screen the following information in a well-formatted tabular arrangement.
Base area of the pyramid, AB, in 3 significant digits.
Surface area of the pyramid, AS, in 4 significant digits.
Volume of the pyramid, V, in 4 significant digits.
Figure 1: A right square pyramid with its base edge, a, height, h.
Use the following formulae for the base area, surface area, and volume:
AB=a2,
AS=a2+2a14a2+h2,2
V=13a2h.
Ensure that your program works for all valid user inputs. Print the results in suitable formats and alignments for a good output visual. Style your code accordingly.
For the submission:
Save your file using YourName.c (without any space characters) as the file name.
Submit only YourName. c in NTULearn. If you need to resubmit, rename your new file as YourName1.c. For subsequent resubmissions, rename as YourName2.c and so on. Only the last file submitted before the due will be graded.
Marking schedule
Prompt the user and take the inputs.
Calculate the base area, surface area, and volume.
Print the results in a well-formatted tabular arrangement.
Keep good coding style (indentation, headers, variable names, etc.).
Total
2 mark
4 mark
3 mark
1 mark
10 mark
 How to round up the answer to 3 significant figure in

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!