Constants : const « Data Type « C Tutorial






#include <stdio.h>

main()
{

  const int x = 20;
  const float PI = 3.14;

  printf("\nConstant values are %d and %.2f\n", x, PI);

}
Constant values are 20 and 3.14








2.27.const
2.27.1.Constants
2.27.2.Define constant float value using const
2.27.3.Constants and Variables with macro