Answers for "find the power of number c++"

C++
1

how to write something in power of a number in c++

#include <iostream>
#include <cmath>
using namespace std;
int main(){
  cout<<pow(10,2);
  return 0;
}
Posted by: Guest on December-02-2020
0

c++ power of a number

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

int main ()
{
	double base, exponent, result;
	
	base = 3.4;
	exponent = 4.4;
	result = pow(base, exponent);
	
	cout << base << "^" << exponent << " = " << result;
	
	return 0;
}
Posted by: Guest on May-18-2021

Browse Popular Code Answers by Language