daily pastebin goal
51%
SHARE
TWEET

Untitled

a guest Dec 9th, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. void input(int&,int&);
  5. void calc(int&, int&, int&);
  6. void output();
  7.  
  8. int main()
  9. {
  10.     int first,power,total;
  11.     input(first,power);
  12.     calc(total,first,power);
  13.     output();
  14.  
  15.     return 0;
  16. }
  17.  
  18. void input(int& first,int& power)
  19. {
  20.     cout << "Enter the number you'd like to add to power" << endl;
  21.     cin >> first;
  22.     cout << "Now enter the power" << endl;
  23.     cin >> power;
  24. }
  25. void calc(int& total,int& first, int& power,int& a)
  26. {
  27.     for(a=power;a<=0;a++)
  28.     {
  29.         total *= power;
  30.     }
  31.  
  32. }
  33. void output(int& total)
  34. {
  35.     cout << "The number is now;" << total << endl;
  36. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top