Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #include <locale.h>
- main(){
- int x;
- double y ;
- double Pi = 3.14159265358979323846;
- for(x=1 ; x <26;x++)
- {
- switch (x)
- {
- case 12: case 15: case 18:
- y = sqrt(1 + pow(cos(2*x),2));
- break;
- case 10: case 11: case 13:
- case 14:case 16:case 17:case
- 19:case 20:
- y = log(pow(x,3)+1.8);
- break;
- case 2:case 3:case 4:case 5:
- case 21:case 22:case 23:case 24:
- y = log(pow(x,3)+1.8);
- break;
- default : y = pow(x,2) + x*5 ;
- break;
- }
- printf(" x =%i\t y=%f\n",x,y);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement