Monday
September 1, 2014

Homework Help: Programming

Posted by Annabelle on Tuesday, April 29, 2014 at 10:55pm.

Write a function that takes one positive integer value (call it n) as a parameter and produces the sum of the integers between 1 and n.

Hint: The sum of the integers from 1 to n is n*(n+1) all over 2

I know this is how the function should look but I am unsure of how to write the actual code!

(n*(n+1))/2

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

math, algebra - 2a+2ab+2b I need a lot of help in this one. it says find two ...
math - Which statement is true? A.The sum of two positive integers is sometimes ...
Math - Let S(n) denote the sum of digits of the integer n. Over all positive ...
discrete math - 1)prove that if x is rational and x not equal to 0, then 1/x is ...
math - there are 8 consecutive integers that add up to 31. Only two of the ...
C Programming - I am trying to find the sum of two integers. I entered the ...
progra - how would i be able to write a function module for average from this ...
Discrete Math - Let n be positive integer greater than 1. We call n prime if the...
C++ - Write a MAIN function and a FUNCTION to compute the sum of the below ...
C++ - Write a MAIN function and a FUNCTION to compute the sum of the below ...

Search
Members