Advertisement
dllbridge

Untitled

Oct 25th, 2024 (edited)
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.13 KB | None | 0 0
  1.  
  2. #include <stdio.h>
  3.  
  4. int  main()
  5.  
  6. {
  7.     int array[3][7]= { 1,2,3,4,5,6,7,8,9,10,11,12,13, 14,15,16,17,18,19,20, 21};
  8.     int* p = &array[2][2];
  9.    
  10.    
  11.     *p = 100;
  12.    
  13.         for (int i = 0; i < 3; i++) {
  14.             for (int j = 0; j < 7; j++) {
  15.  
  16.                 printf("%d ,", array[i][j]);
  17.  
  18.             }
  19.         }
  20.         //printf("%d\n ",array[2][-1]);
  21. }
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28. #include <stdio.h>
  29.  
  30. ////////////////////////////////////////////////////
  31. int  main()
  32. {
  33.     //int array[3][7] = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21 };
  34.    
  35.     int array[3][7] ,
  36.         x = 1;
  37.    
  38.    
  39.    
  40.     for(int i = 0; i < 3; i++)
  41.     for(int j = 0; j < 7; j++)  array[i][j] = x++;    
  42.  
  43.      
  44.     for(int i = 0; i < 3; i++)
  45.     for(int j = 0; j < 7; j++)  printf("%d \n",  array[i][j]);
  46. }
  47.  
  48.  
  49. /*
  50.  
  51.  
  52. */
  53. /*
  54. #include <stdio.h>
  55.  
  56. ////////////////////////////////////////////////////
  57. int  main()
  58. {
  59.     //int array[3][7] = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21 };
  60.    
  61.     int array[3][7];
  62.    
  63.     int *p = &array[0][0];
  64.    
  65.     for(int i = 0; i < 21; i++) p[i] = i + 1;
  66.  
  67.      
  68.     for(int i = 0; i < 3; i++)
  69.     for(int j = 0; j < 7; j++) printf("%d \n",  array[i][j]);
  70. }
  71.  
  72. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement