# How to sum of square intergers?

Page 1 of 1

## 2 Replies - 1152 Views - Last Post: 22 January 2007 - 02:36 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=23150&amp;s=3caf05c100be29d65f0b2599501073b4&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 nmarcio

Reputation: 0
• Posts: 3
• Joined: 22-January 07

# How to sum of square intergers?

Posted 22 January 2007 - 01:44 PM

I'm currently taking data structures but I got no clue about my homework, so if anyone would very kind to show me or explained this question:

Write a function that has a loop, which will sum up the squares of the integers 1 to n. What is the order of your function?.

Thanks!!!!
Is This A Good Question/Topic? 0

## Replies To: How to sum of square intergers?

• g+ + -o drink whiskey.cpp

Reputation: 247
• Posts: 13,505
• Joined: 12-July 02

## Re: How to sum of square intergers?

Posted 22 January 2007 - 02:32 PM

Please post the code you have written so far. Our members would be pleased to provide some guidance.

### #3 PennyBoki

• system("revolution");

Reputation: 53
• Posts: 2,334
• Joined: 11-December 06

## Re: How to sum of square intergers?

Posted 22 January 2007 - 02:36 PM

1*1 + 2*2 + 3*3 + ... + n*n
do this with for loop
and the order thing i think it's the big O
check this:
http://www.dreaminco...wtopic23087.htm