/*sum upto n numbers*/
public static int Sum(int n)
{
int result = 0;
for (int i = 1; i <= n; ++i)
result += i;
return result;
}Data structures, Algorithms, Coding, Technical Interview Questions and much more. (Still work in progress)
0 comments:
Post a Comment