Number of compositions of a natural number | C # program to find the total number of compositions of a natural number ; Return 2 raised to power ( n - 1 ) ; Driver Code
using System ; class GFG { public static int countCompositions ( int n ) { return 1 << ( n - 1 ) ; } public static void Main ( ) { int n = 4 ; Console . Write ( countCompositions ( n ) ) ; } }