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
#include <bits/stdc++.h> NEW_LINE using namespace std ; void CountPair ( int L , int R ) { int x = ( R - L + 1 ) ; cout << x / 2 << " STRNEWLINE " ; } int main ( ) { int L , R ; L = 1 , R = 8 ; CountPair ( L , R ) ; return 0 ; }