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 reads in the radius and length of a cylinder and computes the area and volume using the following formulas: area = radius * radius * π volume = area * length

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

Area and perimeter of an equilateral triangle c++ program