Mega Code Archive

 
Categories / C / Code Snippets
 

Cosine example

#include <stdio.h> #include <math.h> int main() { printf("The cosine of %f is %f.\n",0.5,cos(0.5)); printf("The cosine of %f is %f.\n",1.0,cos(1.0)); printf("The cosine of %f is %f.\n",-1.0,cos(-1.0)); return 0; }