English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

1 answers

Usually with a loop.

For example, sum from 0 to n of i^2 is:

int sum=0;
for (int i=0; i<=n; ++i) sum += (i * i);

2007-08-20 08:01:05 · answer #1 · answered by McFate 7 · 0 0

fedest.com, questions and answers