All possible co | C # implementation of the approach ; Function to count possible pairs ; total count of numbers in range ; printing count of pairs ; Driver code
using System ; class GFG { static void CountPair ( int L , int R ) { int x = ( R - L + 1 ) ; Console . WriteLine ( x / 2 + " STRNEWLINE " ) ; } public static void Main ( ) { int L , R ; L = 1 ; R = 8 ; CountPair ( L , R ) ; } }