fork download
  1. #include <stdio.h>
  2.  
  3. int main(void){
  4. int i = 0;
  5. int a = 0;
  6. int size = 10;
  7.  
  8. for(i=0;i<size;i++){
  9. printf("%d\n",i);
  10. if(i==4){
  11. i=size; /* if i becomes 4 we terminate the loop by setting the i to size */
  12. a = 10; /* we need to set also a to 10 to skip the next check of a and terminate the loop */
  13. }
  14.  
  15. if(a != 10){
  16. printf("A = %d\n\n",a);
  17. a++;
  18. }
  19. }
  20. return 0;
  21. }
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
0
A = 0

1
A = 1

2
A = 2

3
A = 3

4