UNIT 2 2.7 Assignment Statement Flashcards

1
Q

It is the process of assigning a value to a variable. In C, we use the equal sign
(=) as the assignment operator

A

Assignment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How to Assign Values to Variables

A
  1. The variable must be on the left side of the equal sign. Values must be on the right side of the
    equal sign.
  2. Any expression can be assigned on the variable.
  3. Expressions are not allowed on the left side of the assignment operator
Example
X = 31; 
sum = a + b;
Name = “Paolo”; 
K = ‘B’;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly