#include <math.h> #include <iostream> int main() { double α; // alpha double β; // beta double γ; // gamma double δ; // delta double ε; // epsilon double ζ; // zeta double η; // eta double θ; // theta double ι; // iota double κ; // kappa double λ; // lambda double μ; // mu double ν; // nu double ξ; // xi double ο; // omicron double π = M_PI; // pi double ρ; // rho double ς; // final sigma double σ; // small sigma double τ; // tau double υ; // upsilon double φ; // phi double χ; // chi double ψ; // psi double ω; // omega // The area of a circle double r = 10.0; // radius double A = π * r * r; std::cout << "Area is " << A << std::endl; }
Programming Tips - Can I use Greek letters as variable names to more compactly express my formulas?
Date: 2014oct30
Language: C/C++
Product: clang
Q. Can I use Greek letters as variable names to more compactly express my formulas?
A. Yes, clang (as of version 3.3) supports Greek letters as variable
names. All the lowercase letters are listed here. You can copy and paste
directly into your code.