Program to find sum of first n natural numbers | Efficient C # program to find sum of first n natural numbers . ; Returns sum of first n natural numbers ; Driver code
using System ; class GFG { static int findSum ( int n ) { return n * ( n + 1 ) / 2 ; } public static void Main ( ) { int n = 5 ; Console . Write ( findSum ( n ) ) ; } }