Page 1 of 1

2. Write a C++ function to find the sum of the first n natural numbers. The sum of the first n natural numbers is given

Posted: Sat May 14, 2022 3:23 pm
by answerhappygod
2 Write A C Function To Find The Sum Of The First N Natural Numbers The Sum Of The First N Natural Numbers Is Given 1
2 Write A C Function To Find The Sum Of The First N Natural Numbers The Sum Of The First N Natural Numbers Is Given 1 (56 KiB) Viewed 60 times
2. Write a C++ function to find the sum of the first n natural numbers. The sum of the first n natural numbers is given by the following formula: n(n+1) Sum= 2. Your main program should ask the user for the value of n and then call the function which should return the sum back to the main program. a. Draw the flowchart of the whole program using the following link. b. Write the CH code of this program. 1 I Sample Run: Enter the value of n > 10 The sum of the first 10 natural numbers is 55