+ 2

How to make squares of numbers entered in c++

formula????

14th Mar 2018, 2:30 PM
Jatin Jadhav
Jatin Jadhav - avatar
6 Answers
+ 15
might base will come in place of 1 @SD
14th Mar 2018, 2:40 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 12
print num*num or make use of pow(num,2)
14th Mar 2018, 2:33 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
14th Apr 2018, 1:49 AM
Yash🏁🔘
Yash🏁🔘 - avatar
+ 5
you can use a recursive function and build your pow() function like... int calculatePower(int base, int powerRaised) { if (powerRaised != 1) return (base*calculatePower(base, powerRaised-1)); else return 1; }
14th Mar 2018, 2:38 PM
Scooby
Scooby - avatar
+ 4
???@ga
14th Mar 2018, 3:11 PM
Scooby
Scooby - avatar