Given three floating-point numbers x, y, and z, output x to the power of z, x to the power of (y to the power of z), the absolute value of y, and the square root of (xy to the power of z).
#include <iostream>
using namespace std;
int main(){
float x,y,z;
cout<<"Please x: ";
cin>>x;
cout<<"Please y: ";
cin>>y;
cout<<"Please z: ";
cin>>z;
cout<<"x to the power of z: "<<pow(x,z)<<"\n";
cout<<"x to the power of (y to the power of z): "<<pow(x,pow(y,z))<<"\n";
cout<<"The absolute value of y: "<<abs(y)<<"\n";
cout<<"The square root of (xy to the power of z): "<<sqrt(pow(x*y,z))<<"\n";
system("pause");
return 0;
}
Comments
Leave a comment