Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranî)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
0 Now so far what we have seen are all operators that exist in normal mathematics. 1
But here are some that only exist in programming. 2
So take a look at this expression. 3
We create a variable called x and we set it equal to 5. 4
Then we change the value of x to the previous value, which is 5, plus 1. 5
So x now equals 6. 6
Now we've seen this and we've been using this in our previous code. 7
So this should be familiar to you already. 8
But in most programming languages, instead of writing out x = x + 1, you can simply write 9
x++, and, in exactly the same way, x now gets incremented by 1 and is now equal to 6. So x++ 10
is the equivalent of saying x = x + 1, and this is called the increment expression. 11
Now you can go the other way as well. 12
You can write x--, 13
and this is equivalent to x = x - 1. 14
So the previous value of x, 5, minus 1, so x now equals 4. 15
And this is called the decrement expression. 16
Now you might have heard of the programming language C and C++, and this is kind of like a programmer's 17
idea of a good joke, even though nobody else thinks it's funny. 18
But essentially C++ was meant to be an increment on the C programming language. 19
So it's kind of like C plus one, a little bit better than C. Remember that with ++ and --, 20
you're only ever changing the value by one. 21
Now if you ever want to increase the value of x by more than one, then you can use the +=, and 22
this is equivalent to saying x = x + 2. 23
And so x now equals 7. In the same way, 24
you can also use += to increase by the value of another variable. 25
So in this case x = x + y, which is equal to 8. 26
And this also works with -=, *=, /=, 27
and it's a handy shorter way of doing exactly that. 28
So, in the next lesson, 29
I have a brief quiz for you to see if all of this stuck 30
and if it makes sense. 31
So head over there and see if you can complete the multiple choice question and I'll see you on the 32
next module.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.