fork download
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5. {
  6. int sum = 10, j = 2;
  7. sum = sum+j, j++;
  8. std::cout << "sum = " << sum << ", j = " << j << std::endl;
  9. }
  10. {
  11. int sum = 10, j = 2;
  12. sum = sum+j; j++;
  13. std::cout << "sum = " << sum << ", j = " << j << std::endl;
  14. }
  15. }
  16.  
Success #stdin #stdout 0s 3344KB
stdin
Standard input is empty
stdout
sum = 12, j = 3
sum = 12, j = 3