В С++ с переменными можно выполнять как унарные операции, так и бинарные. Унарные - это обычные математические операции (сложение, вычитание, деление, умножение), бинарные операции - это инкремент и декремент
В свою очередь бинарные делятся на префиксные и постфиксные.
Сложение +
Вычитание -
Умножение *
Деление на цело /
Деление с остатком %
Унарные операции с разными типами.
Если в программе выше изменить тип одной из переменных на double, то программа выдаст ряд предупреждений, связанных с тем, что типы двух переменных отличаются. Это решается путем явного присваивания переменной. Например (int)A.
Бинарные операции: ++ увеличивает значение переменной на 1, -- уменьшает значение переменной на 1.
Запись А++ равносильна записи А = А + 1 (или А = А - 1). Это называется постфиксный инкремент/декремент.
Префиксный инкремент/декремент выглядит, как ++А, --А.
Разница в том, что при записи А++ сначала происходит вычисление, а потом прибавление 1 к А. А при ++А сначала прибавляется 1 к А, а затем происходит вычисление.
Как видно в программе, в первом случае в переменную Result присваивается 6, потому что сначала к А прибавляется 1, а потом происходит операция присваивания. Во втором случае Result = 5, потому что
сначала происходит операция присваивания, а потом к А прибавляется 1.
Бинарные операции используются для счета чего-то, например, в циклах. Это будет показано через 1 урок.
Комментарии
gambling
online casinos
casino games
gambling
cialis prescription
active ingredient in cialis
otc cialis
when to take cialis
what is the difference between viagra and cialis
mambo 36 tadalafil 20 mg
casino
slots
online casino
casino
online casino
online casino
casino online
casino game
cost of viagra
viagra boys band
casino games
casino games
slots
casino game
cialis 10mg
cialis coupon free trial
online casinos
online casino
online casinos
casino
clomid cheap
where to get cheap clomid
casino
casino
casino games
casino
cialis order
cheap tadalafil for sale
gambling
casino games
slots
casino online
natural viagra
sildenafil cvs
online casinos
slots
slots
casino games
casinos
casinos online
casino
casino online
online casino
gambling
online casino
online casinos
cialis from canada to usa
cialis for women
purchase tadalafil for sale
cialis 5mg price
online casino
gambling
slots
online casinos
online casino
casino real money
slots
casino online
viagra online without prescription
generic viagra for sale
how much is cialis
cost of cialis at walmart
clomid price
how can i get clomid
[url=https://casinowingames.com/]casinos online[/url]
casinos online
[url=https://casinowellplay.com/]casinos online[/url]
casino real money
[url=https://casinogambiba.com/]casino games[/url]
slots
[url=https://casinoongames.com/]casinos online[/url]
casino online
cialis online
tadalafil order
sildenafil for women
viagra foods
[url=https://casinowingames.com/]casino[/url]
casinos online
[url=https://casinowellplay.com/]casinos online[/url]
casino real money
[url=https://casinogambiba.com/]online casino[/url]
casino games
[url=https://casinoongames.com/]casino[/url]
slots
[url=https://cimgards.com/]difference between viagra and cialis[/url]
cheap cialis from canada
cheap clomid without prescription
buying clomid
buy cialis 5mg pill
order generic cialis 10mg
casino games
online casinos
gambling
online casino
casino real money
casino real money
casinos online
slots
Страницы
Добавить комментарий