Bitwise operators are used in C programming to perform bit-level operations.
OUTPUTANALYSIS In this Assignment Operators in C program example, We declared 2 integer values a Total and we assigned values 7 and 21 respectively.
Lets see what will happen in above example – Constant number 10 will be assigned to variable ‘value’.
Variable ‘value’ will be treated as positive non-zero number, which is considered as true condition.
The thing to keep in mind, though, is that these are assignment operators, so they are all going to change the value of the variable. pizzas To Eat -= 100 will subtract the value of the variable by 100.
pizzas To Eat /= 5 will divide the value by 5 pizzas To Eat *= 2will multiply the value by 2.
Did you read the last blog on Increment and Decrement Operators? For example, we can have something like this: The left side of this will evaluate to 200 and then that will be assigned to pizzas To Eat. It’s a binary operator because it takes some value on the right and assigns to the variable on the left.
In the previous blog I showed you how you can add one to a variable. I also showed you what to do if you wanted to add more than one to a variable.
The left operand must not be an array, a function, or a constant.
The specific conversion path, which depends on the two types, is outlined in detail in Type Conversions.