public static void Main()
Console.WriteLine("By Brandon Eduardo Cortes Correa");
Console.Write("Find the Sum of GP series:\n");
Console.Write("----------------------------");
Console.Write("Input the first number of the G.P. series: ");
g1 = Convert.ToInt32(Console.ReadLine());
Console.Write("Input the number or terms in the G.P. series: ");
ntrm = Convert.ToInt32(Console.ReadLine());
Console.Write("Input the common ratio of G.P. series: ");
cr = Convert.ToInt32(Console.ReadLine());
Console.Write("\nThe numbers for the G.P. series:\n ");
Console.Write("{0} ",gpn);
sum = (g1*(1 - (Math.Pow(cr,ntrm+1))))/(1-cr);
tn = g1 * (Math.Pow(cr,ntrm-1));
Console.Write("\nThe tn terms of G.P. : {0}\n\n",tn);
Console.Write("\nThe Sum of the G.P. series : {0}\n\n",sum);