fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. bool p = true;
  6. for(int i=0;i<2;i++){
  7. bool q = true;
  8. for(int j=0;j<2;j++){
  9. cout<<"p="<<p<<", q="<<q<<endl;
  10. q = false;
  11. }
  12. p = false;
  13. }
  14. return 0;
  15. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
p=1, q=1
p=1, q=0
p=0, q=1
p=0, q=0