How would I do exponent math with C++? | Sololearn: Learn to code for FREE!

0

How would I do exponent math with C++?

I can't figure out how to calculate exponents with C++

8/20/2018 9:42:26 PM

TheDen106

5 Answers

New Answer

+5

Use cmath libray it find function(name is pow)to calculate expoents example: #include<iostream> #include<cmath> using namespace std; int maim(){ int x=3; int y=pow(x,2); cout<<y;//output:9

+4

use loop example:(calculate (5)^4=625) int result,y=1; for(int i=1;i<=4;++i) y*=5; cout<<y;//output:625

+3

welcome😇😇

0

Thanks so much!

0

Oh, I see! Thanks.