For this Question: For an integer N, your task is to calculate sum of first N natural numbers.<b>User Task:</b>
Since this will be a functional problem, you don't have to worry about input. You just have to complete the function <b>sum()</b> which takes the integer N as a parameter.

Constraints:
1 <= N < = 100000000Print the sum of first N natural numbers.Sample Input:-
5

Sample Output:-
15

Sample Input:-
3

Sample Output:-
6, I have written this Solution Code: 
	static void sum(int N){
long x=N;
x=x*(x+1);
x=x/2;
System.out.print(x);
	}
, In this Programming Language: Java, Now tell me if this Code is compilable or not?