Sum of the first n positive integers

Write a program that computes the sum of the first n positive integers, where n is specified by the user. Let’s assume for now that n>0 and n<500. Test it on n=5, n=50 and n=500. The output should be:

enter n: 5
the sum of the first 5 positive integers is: 15

enter n: 50
the sum of the first 50 positive integers is: 1275

enter n: 500
the sum of the first 500 positive integers is: 125250

sample solution