fork download
  1. #include<cstdio>
  2.  
  3. using namespace std ;
  4.  
  5. int main( )
  6. {
  7. int i , j , k , m , n ;
  8. m = n = 2 ;
  9.  
  10. printf("Array Indexes you are printing -\n") ;
  11. for(i=0;i<n-1;i++)
  12. {
  13. for(j=0;j<m-1;j++)
  14. {
  15. for(k=j+1;k<m;k++)
  16. {
  17. printf("i = %d\n",i) ;
  18. printf("j = %d\n",j) ;
  19. printf("k = %d\n",k) ;
  20. printf("k-j+1 = %d\n",k-j+1);
  21. printf("[%d][%d]\n",i,j) ;
  22. printf("[%d][%d]\n",i,k) ;
  23. printf("[%d][%d]\n",k-j+1,k) ;
  24. printf("[%d][%d]\n",k-j+1,j) ;
  25. }
  26. printf("\n\n") ;
  27. }
  28. }
  29.  
  30. return 0 ;
  31. }
  32.  
Success #stdin #stdout 0s 2728KB
stdin
Standard input is empty
stdout
Array Indexes you are printing -
i = 0
j = 0
k = 1
k-j+1 = 2
[0][0]
[0][1]
[2][1]
[2][0]