With a suitable example, explain increment, decrement and compound assignment operators
// composite assignment operators
float x, y;
int a, b;
// +=, -=
a = 8;
b = 5;
a += b; // a = a + b = 13
b -= 4; // b = b - 4 = 1
// *=, /=
x = 4;
y = 5;
x *= y; // x = x * y = 4 * 5 = 20
y /= 2.5; // y = y / 2.5 = 2.0
// &=, |=
a = 8;
b = 3;
a &= b + 5; // a = a & b + 5 = a & (b+5) = 8
a |= b; // a = a | b = 11
// >>=, <<=
a = 34;
a >>= 1; // a = a >> 1 = 17
a = 6;
a <<= 3; // a = a << 3 = 48
// %=
b = 15;
b %= 6; // b = b % 6 = 3
Also in C:
- hello world program
- With which of the following can you run code without provisioning or managing servers and pay only for the compute time consumed (there is no charge when the code is not running)?
- counter program in c language
- Segment tree
- error: ‘cout’ was not declared in this scope
- switch c
- potencia recursiva
- curl authorization header
- how to ascii art in c
- how to use malloc in c
- what is x:Name Xamarin forms
- resto de division recursiva
- why do you jerk while falling aslee
- Write a interactive C program to find the MINIMUM array elements in a given 3X3 matrix.
- Use of memory management unit
- bubble sort time complexity
- molotovn't ribbentropn't pact
- div
- how to modulo decimal c
- partia e vjosa osmanit
- remove element from np array
- declaration in c
- c interview questions for experienced
- rakshabandhan 2020