Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /************************************
- Name: CJ Cunningham
- Date: Mar. 24, 2015
- Proj. Name: calculator
- Proj. Description:
- ************************************/
- #include <stdio.h>
- double factorial(int fac);
- double power(int pow, double wer);
- double exponential(double exp);
- double hypsine(double sin);
- double hypcosine(double cos);
- int main(void)
- {
- int ans1=0;
- while(ans1!=7)
- {
- 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");
- scanf("%d", ans1);
- swtich(ans1)
- {
- case 1:
- }
- }
- }
- double power(double base, int sup)
- {
- double power=1;
- int i=0
- if(sup>0)
- {
- for(i=0; i<sup; i++)
- {
- power*=base
- }
- }
- if else(sup<0)
- {
- for(i=0; i>sup; i--)
- {
- power*=1/base
- }
- }
- return power;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement