Write a program that displays the following table:

(Print a table) Write a program that displays the following table:
x        y       pow(x, y)
2.5   1.2    3.00281
5.0   2.4    47.5913
1.2   3.6    1.92776
2.4   5.0    79.6262
3.6   2.5    24.5899
#Beginner
In gcc c++ compiler using namespace std;


#include<iostream>
#include<cmath>
using namespace std;

int main()
{
cout<<"x\t"<<"y\t"<<"pow(x,y)"<<endl;
cout<<2.5<<"\t"<<1.2<<"\t"<<pow(2.5,1.2)<<endl;
cout<<5.0<<"\t"<<2.4<<"\t"<<pow(5.0,2.4)<<endl;
cout<<1.2<<"\t"<<3.6<<"\t"<<pow(1.2,3.6)<<endl;
cout<<2.4<<"\t"<<5.0<<"\t"<<pow(2.4,5.0)<<endl;
cout<<3.6<<"\t"<<2.5<<"\t"<<pow(3.6,2.5)<<endl;
return 0;
}
copy


Output
x       y       pow(x,y)
2.5     1.2     3.00281
5       2.4     47.5913
1.2     3.6     1.92776
2.4     5       79.6262
3.6     2.5     24.5899

[Program finished]

Need of Programmer

Need of Programmer

Comments

Popular posts from this blog

Write a program that prompts the user to enter two points (x1, y1) and (x2, y2) and displays their distance between them.The formula for computing the distance is

Write a program that prompts the user to enter the side of a hexagon and displays its area. The formula for computing the area of a hexagon is

Write a program that prompts the user to enter the coordinates of two points (x1, y1) and (x2, y2), and displays the slope of the line that connects the two points. The formula of the slope is (y2 - y1)/(x2 - x1).