Convert each of the following mathematical formulas to a C++ expression:
3x
3x + y
x
+
y/7
3x + y
-----------
z + 2
#include <iostream>
using namespace std;
int main()
{
// 3 x in c++ means = 3 * X
// vaiable declaration
int x = 10 , y = 4 , z = 3;
// 3x
cout<< 3 * x<<endl;
// the output will be : 30;
// 3x + y
cout<<(3 * x) + y<<endl;
//x + y/7
cout<<x + (7/y)<<endl;
//3x + y
cout<< 3 *(x + y)<<endl;
//z + 2
cout<< z + 2<<endl;
return 0;
}