Dashboard
Problems
Roadmap
Leaderboard
Sign Up
Log In
Problems
easy
Sum of First N Natural Numbers
2 Koda Coins
⏱ Set Timer
Description
Examples
Editorial
Sum of First N Natural Numbers
easy
⏱ 2s limit
💾 64 MB
Description
Given an integer N, compute the sum of the first N natural numbers.
Input Format
A single integer N.
Output Format
Print the sum.
Constraints
1 <= N <= 10^5
Python 3
C++17
C
Java
JavaScript
Run
Submit
Output
Verdict
▲ Expand