//y * rows + x
for(int y = 0; y < rows; y++)
{
for(int x = 0; x < cols; x++)
{
int point = grid[y * rows + x];
}
}
//C - program to create 1D array using data taken from user
#include <stdio.h>
void main(){
int i,a[100],n;
printf("Enter the no of elements of 1D array: ");
scanf("%d",&n);
printf("Enter the %d elements of the array",n);
for(i = 0; i<n;i++)
{
scanf("%d",&a[i]);
}
}