Write A C++ Constant Declaration To Give Pi A Value 3. 142
Write a C++ constant declaration to give PI a value 3. 142
Answer:
eto nahanap ko
1: #include <iostream>
2:
3: int main()
4: {
5: using namespace std;
6:
7: const double pi = 22.0 / 7;
8: cout << "The value of constant pi is: " << pi << endl;
9:
10: // Uncomment next line to view compile failure
11: // pi = 345;
12:
13: return 0;
14: }
Comments
Post a Comment