Find the sum of series 3 , | calculate sum upto N term of series ; Driver code
class GFG { static int Sum_upto_nth_Term ( int n ) { return ( 1 - ( int ) System . Math . Pow ( - 2 , n ) ) ; } public static void Main ( ) { int N = 5 ; System . Console . WriteLine ( Sum_upto_nth_Term ( N ) ) ; } }