Created
October 19, 2017 09:19
-
-
Save Azim/0f9108543e268d2b4a41cf20b823f26c to your computer and use it in GitHub Desktop.
Generate random array in C/c++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int array[MAX_ROWS][MAX_COLS]; | |
srand(time(NULL)); | |
printf("\n j j j j j"); | |
for(int i=0;i<MAX_ROWS;i=i+1){ | |
printf("\n \n i "); | |
for(int j=0;j<MAX_COLS;j=j+1){ | |
array[i][j]=rand(); | |
if(array[i][j]<10000){ | |
array[i][j]+=10000; | |
} | |
printf("%d ",array[i][j]); | |
} | |
} | |
printf("\n"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output: