Question
*************************************************************************** Name: Student ID: Section: *************************************************************************** [5 MARKS] Write, compile, and run a C program to compute the square and square root of the numbers
*************************************************************************** Name: Student ID: Section: *************************************************************************** [5 MARKS]
Write, compile, and run a C program to compute the square and square root of the numbers from 49 to 85 in increments of 4.
Display the results as shown in the sample run below. Use a field width of 10 for each column. Specify the cube root to 2 decimal places.
Note: You may calculate the square of a number, x, as x * x. Note: The sqrt() function takes an argument of type double and return type is double. Note: Use of the sqrt() function requires inclusion of the math.h header file.
Refer to the sample run below:
NOTE: The Name, Student ID and Section that appears in the output of the program should be your own, not the ones used in the sample run.
--- Sample run 1: --------
*********************************************************************** Name: Smith, Peter Student ID: 300999999 Section: 002 ***********************************************************************
Iteration Square(x) Sq. Root(x)
49 2401 7.00 53 ... ... 57 ... ... 61 ... ... 65 ... ... 69 ... ... 73 ... ... 77 ... ... 81 ... ... 85 7225 9.22 Press any key to continue . . .
PROGRAM OUTPUT - Provide a table similar to the one above and paste it to your WORD document:
*/ #include
int main() {
system("pause"); return 0; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started