Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- #include <time.h>
- int main()
- {
- int n;
- srand(time(0));
- n = rand() % 12 + 2;
- printf("Wylosowana liczba n: %i\n", n);
- int i;
- for(i=0; i<n; i++)
- {
- int angle = 30*i;
- double f1;
- f1 = cos(angle*M_PI/180.0);
- printf("%d", angle);
- printf("cos = %f\n", f1);
- double f2;
- f2 = sin(angle*M_PI/180.0);
- printf("%d", angle);
- printf("sin = %f\n", f2);
- double f3;
- f3 = tan(angle*M_PI/180);
- printf("%d", angle);
- printf("tan = %f\n", f3);
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment