Assignment statement

Assignment statement

Adalah pernyataan penugasan untuk mengisi sebuah variable

Co:

  1. i.              A = 5 —–mengisi variable A dengan nilai 5
  2. ii.             A = B —-mengisi variable A dengan variable B
  3. iii.            A = A + B —mengisi variable A dengan jumlah dari variable A dan B
  4. iv.            A = A + 1 —mengisi variable A dengan jumlah dari variable A dan nilai 1

Assignment statement                         dapat ditulis                       atau

A = A + B;                                                  A += B;

A = A – B;                                                   A – = B;

A = A * B;                                                   A * = B;

A = A / B;                                                   A / = B;

A=A – 1;                                                      A – = B;                                A–

A = A + 1;                                                   A + = B;                              A++

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s