Programming - Minimum, maximum, sum and product for a matrix, in language C

SoccerBoss
Category:
Programming
Price: $10 USD

Question description

 Pretending that the cosine function, cos(x) , is not available in the C compiler, create your own cos(x) using

cos (x) = 1 -x2
2!
+x4
4!
-x6
6!
+ ¼

Background.

and demonstrate your program by making a table as:

xmycos(x)cos(x)
0.01.0001.000
0.11.1011.105
0.21.3081.221
.........
1.01.691.781

where mycos(x) is from your program and cos (x) is the C-supplied function in math.h.

Note:

  1. The values above are false.
  2. The following is the general form of cos (x).
    cos(x) =¥
    å
    i=0
    (-1)i xi
    (2 i)!
    ,
  3. Take first 10 terms for the series.

Template:

#include <stdio.h>
#include <math.h>
int factorial(int n)
{
(your code here)
}

float mycos(float x)
{
 float sum=0; int i;
 for (i=0;i<=10;i++) sum = sum + (your code here);
 return sum;
}

int main()
{
 int i=1;

 for (i=1;i< .......) printf(.......);

return 0;
}


Studypool has helped 1,244,100 students
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1831 tutors are online

Related Programming questions

03/17/2014
03/15/2014
03/15/2014

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors