What is the output for compound operator? - C Operator

C examples for Operator:Compound Operator

Description

What is the output for compound operator?

Demo Code

#include <stdio.h> 
int main()/*from   w  w  w .  j a v  a2  s.  co m*/
{ 
   int x = 1; 
   int y = 2; 

   x = y * x + 1;   //arithmetic operations performed before assignment 
   printf("\nThe value of x is: %d\n", x); 
   x = 1; 

   y = 2; 
   x += y * x + 1;   //arithmetic operations performed before assignment 
   printf("The value of x is: %d\n", x); 
}

Result


Related Tutorials