Dynamic initialization. : Variables « Language Basics « C++ Tutorial






#include <iostream> 
using namespace std; 
  
int main() { 
  double radius = 4.0, height = 5.0; 
 
  // dynamically initializ volume 
  double volume = 3.1416 * radius * radius * height; 
 
  cout << "Volume is " << volume; 
 
  return 0; 
}
Volume is 251.328"








1.3.Variables
1.3.1.Assign value to a variable
1.3.2.Dynamic initialization.
1.3.3.A scoping example
1.3.4.Using the unary scope resolution operator
1.3.5.Finding maximum and minimum values for data types
1.3.6.Comparing data values