what symbol is used in c++ to represent square(e.g the square of 3 is 9) and cube? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

what symbol is used in c++ to represent square(e.g the square of 3 is 9) and cube?

6th Sep 2016, 1:12 PM
Cody Arthur
Cody Arthur - avatar
3 Answers
+ 2
There is no square or cube operator in C++. You have to use pow from math.h. #include <iostream> #include <math.h> using namespace std; int main(void) { cout << pow(42.0, 2.0) << endl; //square cout << pow(42.0, 3.0); //cube return 0; }
6th Sep 2016, 1:22 PM
Zen
Zen - avatar
0
and what is for suare root?
6th Sep 2016, 5:05 PM
Suhail Pappu
Suhail Pappu - avatar
0
sqrt() function
6th Sep 2016, 6:20 PM
Sarang Kulkarni
Sarang Kulkarni - avatar