Important Notice:

Course Content
Building IoT Applications (Chapter-4) M4-R5.1
About Lesson

Two ways to define constant in C

       There are two ways to define constant in C programming.

i. const keyword

ii. #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.

 #include <stdio.h>

 #include <conio.h>

void main(){

const float PI=3.14;

clrscr();

printf(“The value of PI is: %f”,PI);

getch();

}

error: Content is protected !!