#include<iostream>
#define PI 3.14159
#define NEWLINE '\n'
int main()
{
double r = 5; // radius
double circle;
circle = 2 * PI * r;
std::cout << circle;
std::cout << NEWLINE;
}
#include<iostream>
const double pi = 3.14159;
const char newline = '\n';
int main()
{
double r = 5;
double circle;
circle = 2 * pi * r;
std::cout << circle;
std::cout << newline;
}
#include <iostream>
#include <string>
int main()
{
// std::string mystring;
// mystring = "This is a sting";
std::string mystring ("This is a string");
std::cout << mystring;
return 0;
}
// initialization of variables
#include <iostream>
using namespace std;
int main ()
{
int a=5; // initial value: 5
int b(3); // initial value: 3
int c(2); // initial value: 2
int result; // initial value undetermined
a = a + b;
result = a - c;
cout << result;
return 0;
}
// operating with variables
#include <iostream>
using namespace std;
int main ()
{
// declaring variables:
int a, b;
int result;
// process:
a = 5;
b = 2;
a = a + 1;
result = a - b;
// print out the result:
cout << result;
// terminate the program:
return 0;
}