fork download
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5. int x;
  6. for (x=1; x<7;x++)
  7. {
  8. std::cout<<"Before : "<<x<<'\n';
  9. x=x*x;
  10. std::cout<<"After : "<<x<<'\n';
  11. }
  12. std::cout<<x;
  13. return 0;
  14. }
Success #stdin #stdout 0s 4340KB
stdin
Standard input is empty
stdout
Before : 1
After : 1
Before : 2
After : 4
Before : 5
After : 25
26