fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int x;
  5. int y;
  6.  
  7. for( x=2, y=1; x<11; x++ ) {
  8. printf("antes x = %d, y= %d \n", x, y );
  9. y += x++;
  10. printf("depois x = %d, y= %d \n", x, y );
  11. }
  12. printf("final x = %d, y= %d \n", x, y );
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
antes  x = 2, y= 1 
depois x = 3, y= 3 
antes  x = 4, y= 3 
depois x = 5, y= 7 
antes  x = 6, y= 7 
depois x = 7, y= 13 
antes  x = 8, y= 13 
depois x = 9, y= 21 
antes  x = 10, y= 21 
depois x = 11, y= 31 
final  x = 12, y= 31