sum of n natural numbers
CodeChefOpen on judge ↗
The positive numbers 1,2,3 ... are known as natural numbers. Formula for Sum of First n natural numbers is : n(n+1)/2. If you want to add first 5 Natural number then we find the Sum of 1+2+3+4+5 =15.The positive numbers 1,2,3 ... are known as natural numbers. Formula for Sum of First n natural numbers is : n(n+1)/2. If you want to add first 5 Natural number then we find the Sum of 1+2+3+4+5
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start