Variable Declarations :

The memory cells used for storing a program’s input data and its computational
results are called variables, because the values stored in variables can
change during program execution. Before a variable can be used in a C program, it
must be declared.

Variable declarations communicate to the C compiler the names of all variables
used in a program. They also specify the data type of each variable, which tells
the compiler what kind of information will be stored in the variable and how that
information should be represented in memory. Without variable declarations, the
compiler would not know how much memory to allocate for a variable or how to
interpret the stored value.
SYNTAX:

int variable_list;
double variable_list;
char variable_list;
EXAMPLE:

#include<stdio.h>


int main(){
    int a = 1; // Declaring a variable & assigning 1 value 
    printf("%d",a);
  return 0;
}

Output:

1
Previous Next