Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int ft_sum_n_pow(int a, int b, int pow)
- {
- int sum, ret;
- sum = a + b;
- ret = 1;
- while (pow > 0)
- {
- ret *= sum;
- --pow;
- }
- return (ret);
- }
- int main()
- {
- int a, b, x;
- cout << "Please enter value for a, b and x" << endl;
- cout << "a = ";
- cin >> a;
- cout << "b = ";
- cin >> b;
- cout << "x = ";
- cin >> x;
- cout << endl << ft_sum_n_pow(a, b, x) << endl;
- return (0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement