Sum of Even Numbers till N

Easy
0/40
14 upvotes
Asked in companies
MaerskTransunion

Problem statement

Given a number N, print sum of all even numbers from 1 to N.

Detailed explanation ( Input/output format, Notes, Images )
Input Format :
Integer N
Output Format :
Required Sum 
Sample Input 1 :
 6
Sample Output 1 :
12
Sample Input 2 :
 7
Sample Output 2 :
12
Approaches (1)
Time Complexity
Space Complexity
Code Solution
(100% EXP penalty)
Sum of Even Numbers till N
Full screen
Console