Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Assume a is an integer variable, then the expression (a=4*5,a*2), the value of a+6 is ().
Assume a is an integer variable, then the expression (a=4*5,a*2), the value of a+6 is ().

int a;

a=4*5;

a=a*2;

printf("%d", a+6)

The comma will separate two expressions. (a=4*5, a*2) can be a=4*5;a=a*2;

For example:

a=4*5, a=20 ;

a*2, a is still 20,;

a+6, get 26

The result of the comma operator is the value after the last comma The value of the expression, so the result is 26, at this time a=26

Extended information:

int a,b,c; (a,b,c are integer variables)

long x,y; (x,y are long integer variables)

unsigned p,q; (p,q are unsigned integer variables)

< p>One variable name of integer type or multiple variable names separated by commas

Similarly, unsigned int and unsigned long type variables can also be defined.

Baidu Encyclopedia-Integer Variable