Write a program to find the area of Circle using Constant.|| Explanation of Above Description|coding

preview_player
Показать описание
Constant: A constant is an identifier whose value cannot be changed throughout the execution of the
program. Constant is declared with “const” keyword.
PI=3.14; // error message: Cannot modify a const object

List of Constants in C
Constant Example
Decimal Constant 10, 20, 450 etc.
Real or Floating-point Constant 10.3, 20.2, 450.6 etc.
Octal Constant 021, 033, 046 etc.
Hexadecimal Constant 0x2a, 0x7b, 0xaa etc.
Character Constant 'a', 'b', 'x' etc.
String Constant "c", "c program", "c " etc.

2 ways to define constant in C
There are two ways to define constant in C programming.

2.#define preprocessor
1) C const keyword
The const keyword is used to define constant in C programming.

const float PI=3.14;
Now, the value of PI variable can't be changed.
2) C #define preprocessor
The #define preprocessor is also used to define constant. We will learn about #define preprocessor directive later.

Visit here for: #define preprocessor directive.

#clanguage #javascript #programming #turbo #cprogramming #coding #codinglife #codingninja #programminglife #programmingmemes #programminglanguag #programmingpython

Please Subscribe Channel
Like, Share and Comment

Support
Рекомендации по теме