+ 1

Which one is correct? a=PI*pow(r,2) or a=PI*pow(r,2); where #define PI 3.14

27th Sep 2017, 11:13 AM
Serjeel Ranjan
Serjeel Ranjan - avatar
3 Respostas
+ 12
#define PI 3.1415 int main() { int r = 2; double a = PI * pow(r, 2); std::cout << a; // output : ~ 12.5664 }
27th Sep 2017, 11:24 AM
Babak
Babak - avatar
+ 11
Absolutely Serjeel.
27th Sep 2017, 11:30 AM
Babak
Babak - avatar
+ 1
a semicolon is required right?
27th Sep 2017, 11:27 AM
Serjeel Ranjan
Serjeel Ranjan - avatar