Sum of all the numbers present at given level in Modified Pascal ’ s triangle | Java program to calculate sum of all the numbers present at given level in an Modified Pascal 's triangle ; Function to calculate sum ; Driver Code
class GFG { static void ans ( int n ) { if ( n == 1 ) System . out . println ( "1" ) ; else System . out . println ( "0" ) ; } public static void main ( String [ ] args ) { int n = 2 ; ans ( n ) ; } }