Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main(void) {
  5. float a = 1.8;
  6. float x = -2;
  7. float delta = 0.5;
  8. float Y;
  9. for (;x =< 2; x = x + delta){
  10.  
  11. if(x >= 1) {
  12. Y = log(x);
  13. } else if (-1 < x && x < 1) {
  14. Y = sqrt(pow(x, 2) + pow(a, 3))/a;
  15. } else if (x <= 1) {
  16. Y = exp(x);
  17. }
  18. printf("y=%f", Y);
  19. }
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement