Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ define constant

#include <iostream>
using namespace std;

#define PI 3.14159
#define NEWLINE '
'

int main ()
{
  double r=5.0;               // radius
  double circle;

  circle = 2 * PI * r;
  cout << circle;
  cout << NEWLINE;

}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Source by cplusplus.com #
 
PREVIOUS NEXT
Tagged: #define #constant
ADD COMMENT
Topic
Name
9+7 =