Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3. int main()
  4. {
  5. int p, r, n, y;
  6. printf("please enter the money:");
  7. scanf("%d",&p);
  8. printf("please enter the percent:");
  9. scanf("%d",&r);
  10. printf("please enter the years:");
  11. scanf("%d",&n);
  12. y=p*pow(1+0.01*r,n);
  13. printf("your final money is:%d",y);
  14.  
  15.  
  16.  
  17. return 0;
  18. }
  19.  
  20.  
  21.  
  22.  
  23. /*
  24. int main()
  25. {
  26. int x1, x2, y1, y2, mx, my, answer;
  27. printf("please enter x1:");
  28. scanf("%d",&x1);
  29. printf("please enter y1:");
  30. scanf("%d",&y1);
  31. printf("please enter x2:");
  32. scanf("%d",&x2);
  33. printf("please enter y2:");
  34. scanf("%d",&y2);
  35. mx=x1/2+x2/2;
  36. my=y1/2+y2/2;
  37. printf ("your mid point is (%d,%d)",mx ,my);
  38.  
  39. return 0;
  40. }
  41. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement