#include <stdio.h> int main(void) { int x; int y; for( x=2, y=1; x<11; x++ ) { printf("antes x = %d, y= %d \n", x, y ); y += x++; printf("depois x = %d, y= %d \n", x, y ); } printf("final x = %d, y= %d \n", x, y ); return 0;}
Standard input is empty
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
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!