Advertisement
Hanaigi

Untitled

Nov 30th, 2023
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<conio.h>
  3. #include<graphics.h>
  4. #include<dos.h>
  5. #include<math.h>
  6.  
  7. int main(){
  8. initwindow(640,320);
  9. float f1 = 0, f2 = 0;
  10.  
  11. setcolor(RED);
  12. for(float x = 0.; x < 2.1; x+=0.1){
  13. f1 = pow(x,3);
  14. f2 = sqrt(x);
  15. line((x - 0.1) * 100, pow(x - 0.1,3) * 100 + 160, x * 100, f1 * 100 + 160);
  16. line((x-0.1) * 100, sqrt(x-0.1) * 100 + 160 , x * 100, f2 * 100 + 160);
  17.  
  18. }
  19.  
  20. setfillstyle(1,4);
  21. floodfill(10,161,4);
  22. outtextxy ( 20, 300, "f(x)=pow(x,3);" );
  23. outtextxy ( 120, 250, "f(x)=sqrt(x);" );
  24.  
  25. setcolor(WHITE);
  26. moveto(0,0);
  27. lineto(0,320);
  28. moveto(0,160);
  29. lineto(640,160);
  30.  
  31. getch();
  32. closegraph();
  33. }
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement