Assignment operators in c

Assignment operators are used to assigning values. the most commonly used assignment operator is =

OperatorExampleExample
=a = ba = b
+=a += ba = a+b
-=a -= ba = a-b
*=a *= ba = a*b
/=a /= ba = a/b
%=a %= ba = a%b

example:

//codeskulls
#include
int main()
{
int a =10, c;
c = a;
printf("c = %d \n", c);
c += a; // c = c+a
printf("c = %d \n", c);
c -= a; // c = c-a
printf("c = %d \n", c);
c *= a; // c = c*a
printf("c = %d \n", c);
c /= a; // c = c/a
printf("c = %d \n", c);
c %= a; // c = c%a
printf("c = %d \n", c);
return 0;
}
//codeskulls

output:

c = 10
c = 20
c = 10
c = 100
c = 10
c = 0
Press any key to continue . . .