Advertisement
Guest User

Untitled

a guest
Mar 27th, 2015
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. /************************************
  2. Name: CJ Cunningham
  3. Date: Mar. 24, 2015
  4. Proj. Name: calculator
  5. Proj. Description:
  6. ************************************/
  7.  
  8. #include <stdio.h>
  9.  
  10. double factorial(int fac);
  11. double power(int pow, double wer);
  12. double exponential(double exp);
  13. double hypsine(double sin);
  14. double hypcosine(double cos);
  15.  
  16. int main(void)
  17.  
  18.  
  19. {
  20. int ans1=0;
  21.  
  22. while(ans1!=7)
  23. {
  24. printf("What would you like to do?\n 1-Fatctorial\n 2-Power\n 3-Exponential\n 4-Hyperbolic Sine\n 5-Hyperbolic Cosine\n 6-Test functions 3,4,and 5\n 7-Exit\n");
  25. scanf("%d", ans1);
  26.  
  27. swtich(ans1)
  28. {
  29. case 1:
  30.  
  31. }
  32. }
  33.  
  34. }
  35. double power(double base, int sup)
  36.  
  37. {
  38. double power=1;
  39. int i=0
  40.  
  41. if(sup>0)
  42. {
  43. for(i=0; i<sup; i++)
  44. {
  45. power*=base
  46. }
  47. }
  48. if else(sup<0)
  49. {
  50. for(i=0; i>sup; i--)
  51. {
  52. power*=1/base
  53. }
  54. }
  55. return power;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement