#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> int main(int argc, char **argv){ float index; for(index = 0; index <= 360; index++){ index = (3.14/180) * index; //convert to radiant float a = cos(index); printf("a = %f\n", a); } }
float a = cos(3.14); printf("a = %f\n", a);
cos(double)
cos(float)
double
cos()
cos(3.14)
cos(3.14f)
float index
cosf(float)
cosf()
gcc myprogram.c -lm
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)