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 reads the subtotal and the gratuity rate, then computes the gratuity and total. For example, if the user enters 10 for subtotal and 15% for gratuity rate, the program displays $1.5 as gratuity and $11.5 as total.

Write a program that prompts the user to enter the min- utes (e.g., 1 billion), and displays the number of years and days for the minutes. For simplicity, assume a year has 365 days