Number of ways in which N can be represented as the sum of two positive integers | C # implementation of the approach ; Function to return the number of distinct ways to represent n as the sum of two integers ; Driver code
using System ; class GFG { static int ways ( int n ) { return n / 2 ; } public static void Main ( ) { int n = 2 ; Console . WriteLine ( ways ( n ) ) ; } }