Check if a Rook can reach the given destination in a single move | C # program to implement the above approach ; Function to check if it is possible to reach destination in a single move by a rook ; Driver Code ; Given arrays
using System ; class GFG { static string check ( int current_row , int current_col , int destination_row , int destination_col ) { if ( current_row == destination_row ) return " POSSIBLE " ; else if ( current_col == destination_col ) return " POSSIBLE " ; else return " NOT ▁ POSSIBLE " ; } public static void Main ( ) { int current_row = 8 ; int current_col = 8 ; int destination_row = 8 ; int destination_col = 4 ; string output = check ( current_row , current_col , destination_row , destination_col ) ; Console . WriteLine ( output ) ; } }