Skip to content

Instantly share code, notes, and snippets.

@lifostack
Last active March 21, 2019 16:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lifostack/7cbc65ec8952fbca1e606273d6c33bc4 to your computer and use it in GitHub Desktop.
Save lifostack/7cbc65ec8952fbca1e606273d6c33bc4 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#define MONTHS 12
#define YEARS 5
int main(void)
{
float rain[YEARS][MONTHS];
int b;
for (int x = 0; x < YEARS; x++)
{
srand(x);
for (int y = 0; y < MONTHS; y++)
{
b = rand();
rain[x][y] = b;
printf("RAIN[%d][%d] = %d\n",x,y,rain[x][y]);
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment