Detect Cycle in Directed Graph

I am trying to implement this following the video but I have made some mistake that I am not able to find out. Can you tell ? My code is : https://ide.codingblocks.com/s/243072

in line no 28
corrected condition is
else if(visited[i]==false)
or you can write
else if(visited[i]==false)

Modified Code

i hope this help
if you have more doubts regarding this feel free to ask
if your doubt is resolved mark it as resolved from your doubt section inside your course