- 0
Notifications Mark All Read
- Login
- Get Prime
Cognizant Coding Question- 2
Access Denied!
To view this page you have to login first
Login here -
Trivia
Did you know 1 million people use PrepInsta everyday?
Notifications Mark All Read
To view this page you have to login first
Login here -
Did you know 1 million people use PrepInsta everyday?
#include
#include
int path(int maze[3][3]);
int main()
{
int i,j,maze[3][3], result=0;
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
scanf ("%d", &maze[i][j]);
}
printf("%d", path(maze));
return 0;
}
int path(int m[3][3])
{
static int i;
int j;
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
if((m[i][j]==1))
path(m[3][3]);
if(m[i][j]==0)
return 0;
if(m[i][j]==9)
return 1;
}
}
}