Cognizant Interview Question

Write a program that make sum of first N numbers in java using for loop and while loop seperately.