1. Engineering
  2. Computer Science
  3. programming language c fill the blank...

Question: programming language c fill the blank...

Question details

111. Filling the blanks in programs (20%) 1. Complete the following program calculates the cubic of variable fx by calling a user defined finction cubic. The running result is as below:(8 marks) Please input the value for f: The cubic of 2.0 is 8.00 void main float fx,ans; printf Please input the value for fx: In ans- printf(The cubic of%.1 f is %2fn,fx ans); float cubic(float x) float res following π=1-1+1-1+ The following code is intended to approximate π with a precision less than 0.0001. This means the update of the Thages no more tan 0.0001. The running result is as π has a crucial importance in mathematics, physics, etc. Its value can be approximated by the below:-3.141647 (8 marks) #include<stdio.h> Ninclude<math.h> void maino ( float pi = 4.aitem.1.0; inti-1; while( pi + printfiz= %fa..pi); Page 4
Programming language C++
Fill the blank
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution