#include <stdio.h>
#include <stdlib.h>
int main()
{
int a,c;
printf("enter a value");
scanf("%d",&a);
c=a;
printf("value of c with operator = is %d\n",c);
c += a;
printf("value of c with operator += is %d\n",c);
c-=a;
printf("value of c with operator -= is %d\n",c);
c*=a;
printf("value of c with operator *= is %d\n",c);
c/=a;
printf("value of c with operator /= is %d\n",c);
c=200;
c%=a;
printf("value of c with operator %= is %d\n",c);
c<<=a;
printf("value of c with operator <<= is %d\n",c);
c>>=a;
printf("value of c with operator >>= is %d\n",c);
c&=a;
printf("value of c with operator &= is %d\n",c);
c^=a;
printf("value of c with operator ^= is %d\n",c);
c|=a;
printf("value of c with operator |= = is %d\n",c);
return 0;
}
OUTPUT
Enter a value 21
Value of c with operator = is 21
Value of c with operator += is 42
Value of c with operator -= is 21
Value of c with operator *= is 441
Value of c with operator /= is 21
Value of c with operator %= is 11
Value of c with operator <<= is 23068672
Value of c with operator >>= is 11
Value of c with operator &= is 1
Value of c with operator ^= is 20
Value of c with operator |= is 21
No comments:
Post a Comment