Check whether a number can be represented as difference of two squares | C # program to check whether a number can be represented by the difference of two squares ; Function to check whether a number can be represented by the difference of two squares ; Checking if n % 4 = 2 or not ; Driver code
using System ; class GFG { static bool difSquare ( int n ) { if ( n % 4 != 2 ) { return true ; } return false ; } public static void Main ( ) { int n = 45 ; if ( difSquare ( n ) ) { Console . Write ( " Yes STRNEWLINE " ) ; } else { Console . Write ( " No STRNEWLINE " ) ; } } }