fork download
  1. #include <stdio.h>
  2.  
  3. int main(int argc, char *argv[]){
  4.  
  5. int array[4][4];
  6. int i, j;
  7.  
  8. for(i = 0; i < 4; i++){
  9. for(j = 0; j < 4; j++){
  10. array[i][j] = (i+1)*(j+1);
  11. printf("%d ", array[i][j]);
  12. }
  13. printf("\n");
  14. }
  15.  
  16. int *ptr = &array[0][0];
  17. for(i = 0; i < 16; i++){
  18. printf("%d ", ptr[i]);
  19. }
  20.  
  21.  
  22. printf("\n");
  23. return 0;
  24. }
Success #stdin #stdout 0s 2248KB
stdin
Standard input is empty
stdout
1 2 3 4 
2 4 6 8 
3 6 9 12 
4 8 12 16 
1 2 3 4 2 4 6 8 3 6 9 12 4 8 12 16