Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Assignment Statements

* An assignment statementis to store a value in a variable

variable name = a value or an expression;

— Declaration must be done before assigning a value to a variable !!!

Examples
int a; a = 3; & 1int a = 3; < int a = 3.56;
double £ = 3560.1; < double f = 3.56le3;
char ¢ = ’'a’; < char ¢ = 97;
int a, b, &= 5;
int a=b=c=5; & int a=5, b=5, c=5;
X myes+2.0;
X=X + 1;

CP104 Introduction to Programming Overview of C Lectured 1

You might also like