I filled the first column with random numbers in the range of [20,25], now I want the user to fill the second column with random numbers in the range of [20,25]. How can I do that?
#include <stdio.h> void main() { int Temperature[5][2] = {{20},{21},{22},{23},{24}}; printf("I created a 2D array of size 5x2,"); printf("and I filled the first column with random values in the range [20,25]\n"); for(int i=0; i<5; i++) { printf("%d ",Temperature[i][0]); printf("\n"); } printf("Please fill the second column with values in the range [0,20]\n"); int i, j; for(j=0;j<5;j++) { printf("Value[%d]:",j); scanf("%d", &Temperature[0][j]); } }
scanf("%d", &Temperature[j][1]);