Advertisement
payjack

fail

Oct 24th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. //extra credit
  2. //calculating exponents
  3.  
  4. #include <iostream>
  5. #include <iomanip>
  6.  
  7. using namespace std;
  8.  
  9. void input (int base, int exp)
  10. {
  11.    cout<<"Exponent calculator"<<endl;
  12.    cout<<"Please enter the base : "<<endl;
  13.    cin>>base;
  14.    cout<<"Please enter the exponent : "<<endl;
  15.    cin>>exp;
  16. }
  17.  
  18. void output ()
  19. {
  20.     cout<<base<<" raised to the "<<exp<<" power is "<<answer<<endl;
  21. }
  22.  
  23. calcExp (int base, int exp)
  24. {
  25.   for(i=1; i<exp; i++)
  26.     if (exp<0){
  27.        
  28.     }
  29.     result *= base;
  30.    
  31.    
  32. }
  33. int main ()
  34. {
  35.     int base;
  36.     int exp;
  37.     int answer;
  38.     void input (base, exp);
  39.     void output (base, exp, answer);
  40.    calcExp()
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement