fork download
  1. #include <iostream>
  2. #include <cstdio>
  3. using namespace std;
  4.  
  5. int main() {
  6. int i = 0;
  7.  
  8. const int size = 3;
  9. int tab[size];
  10.  
  11. while(i<size)
  12. {
  13. tab[i] = i;
  14. printf("tab[%i] = %i\n", i, tab[i]);
  15. i++;
  16. }
  17. cout << endl;
  18.  
  19. for(int j = 0; j < size; j++){
  20. tab[j] = j;
  21. printf("tab[%i] = %i\n", j, tab[j]);
  22. }
  23.  
  24. return 0;
  25. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
tab[0] = 0
tab[1] = 1
tab[2] = 2

tab[0] = 0
tab[1] = 1
tab[2] = 2