Detect if two integers have opposite signs | C # Program to Detect if two integers have opposite signs . ; Function to detect signs ; Driver Code
using System ; class GFG { static bool oppositeSigns ( int x , int y ) { return ( ( x ^ y ) < 0 ) ; } public static void Main ( ) { int x = 100 , y = - 100 ; if ( oppositeSigns ( x , y ) == true ) Console . Write ( " Signs ▁ are ▁ opposite " ) ; else Console . Write ( " Signs ▁ are ▁ not ▁ opposite " ) ; } }