#include<iostream>
using namespace std;
// calculates 2 numbers of formula a^2 + b^2 + 2ab = (a+b)^2
void basicMath(int a, int b) {
int totalSum = a*a + b*b + 2*a*b;
cout << totalSum << " " << endl;
}
int main(){
basicMath(2, 5);
return 0;
}
OUTPUT-
49
No comments:
Post a Comment