You have used two different names for your check variable. Use proper names and such errors become much easier to see. Also, why are you using the variable in the first place? Just print a comment for both cases from the if statement.
if (NetworkInterface.GetIsNetworkAvailable()) {
printf("Interface available\n");
}
else {
printf("No interfaces found\n");
}