1.

What is the difference between a constant variable and a global variable?

Answer»

CONSTANT variables have a fixed value that cannot be modified throughout the program. Global variables can be changed and are accessible by all the functions in a program. 

For example:

#include<stdio.h>int m = 20, n = 40; //global variableint a = 50, b = 80;//global variableint MAIN(){printf("These are variables are accessed from main FUNCTION");a=24;void sample(){int t=20; // Local variable}}


Discussion

No Comment Found