Breaking News

How to Assigning values into the Variables in C Programming Language?

To assign values to the variables, assignment operator (=) is used.

Syntax of assigning values:

variable declaration;
Variable_name = value;

Example of assigning values:

Int i , j;
j = 5 ;
i = 0 ;

It is also possible to assign a value at the time of declaration.
int i = 5;

More than one variable can be initialized in one statement using multiple assignment operators.

e.g. j = m = 2;

There could be an exception while using multiple assignment operators.

e.g. int i , j = 2 , k;

here the assignment will be i = 0 j=2 and k = garbage value

An example program which shows the example of assignments:

Output of the Program:
. .

Check Also

Evaluation of expression In C Programming Language

An expression is a combination of variables, constants and operators arranged according to the syntax of the language. C …