Valid Assignment Statements
- int x = 10; An integer value of 10 is assigned to integer variable x
char flag = 'y'; A value of y is assigned to character variable flag
- float y = 20; The integer value 20 is promoted to 20.0 and then assigned to
float variable y
int x = 22.45; The float value 22.45 is truncated to the integer value 22, and
then assigned to integer variable x
Back to Previous Page
Document:
Local Date:
Last Modified On: