How to write a c program to search function for sequence in C Programming Language ?
Solution:
int num = r;
int i, j, k;
int temp = 0;
for (i=0;i<DIM;i++)
{
for (j=0;j<DIM;j++)
{
if (arr[i][j] == num)
{
for (k=1; k < DIM-j; k++)
{
if (arr[i][j+k] == num)
continue;
else if (arr[i+k][j] == num)
continue;
else if (arr[i+k][j+k] == num)
continue;
else if (k > temp);
temp = k;
*p = i;
*q = j;
}
}
}
}