CONSTANTS AND VARIABLE

Constants:a value which remains fixed, which cannot change.

const int myNum = 15;  // myNum will always be 15
myNum = 10;  // error: assignment of read-only variable 'myNum'

Variable:a variable is an entry that may change.

                                           x    

 

 

 

 

 

 

 

5

 

 

 

 

 

 

 

 

 

 

 

 

                                            x   

 

 

 

 

 

 

 

3

 

 

 

 

 

 

 

 

 

 

 

 

 

#include<stdio.h>

void main()

{

  int x=5;

  printf(“%d”, x);

  x=3;

  printf(“%d”, x);

}

Output : 5 3