SHARE
TWEET

All assignment operators

Tahamina_Taha Aug 17th, 2019 (edited) 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. #include<math.h>
  3. // All   assignment  operators
  4. int main()
  5. {
  6.     int a,result;
  7.     printf(" Enter  integer values of a: \n");
  8.     scanf("%d",&a);
  9.      result=a;
  10.      printf("result=%d\n",result);
  11.      result +=a;// result =result+a
  12.      printf("result=%d\n",result);
  13.     result -=a; //result=result-a
  14.      printf("result=%d\n",result);
  15.      result *=a; //result=result *a
  16.      printf("result=%d\n",result);
  17.      result /=a; //result =result/a
  18.      printf("result=%d\n",result);
  19.      result %=a; //result =result %a
  20.      printf("result=%d\n",result);
  21.      return 0;
  22.      }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top