#Meta-Wlp: #Macro: TITLE wlp: Learn C (II) p. 3 #Eval: $TITLE$ #Macro: PAGE bb2-3

Yes, but how easy is 1, 2 4?

The + and = operators are similar in that they evaluate to a value depending to arguments. That is why these operators are called binary. In the case of the = operator, there is also a side-effect, the left-hand-side, which must be a variable, is updated.

There are operators that combine arithmetic and assignment, such as += and *=. Try to guess how these operators work.

#include<stdio.h>

int main(){
  int count ;

  count = 1 ;
  printf("It's as easy as %d,", count ) ;
  count += 1 ;
  printf(" %d,", count ) ;
  count += 2 ;
  printf(" %d!\n", count ) ;

}
#Shuffle: none $PAGE$-A $PAGE$-B $PAGE$-C Return to Learn C Introduction #: It prints out 1, 1, 2. #: It prints out 1, 2, 3. #: It prints out 1, 2, 4. #: