|
A simple programming question
hi..
i was thrown this question yesterday from a friend of mine..
Using a single processor, an algorithm to compute the sum of eight numbers held in an array can be
expressed as follows:
set sum to zero
set counter to zero
WHILE counter < 8 Do
increment counter by 1
add number [counter] to sum
ENDWHILE
output sum
The same operation of summing eight numbers can be executed by using four processors in
parallel. Describe, how this could be done in C#?
Any suggestions?
i know you are grouping integers and possibly passing parameters.. but then since i have just started to learn C#, i can't exactly come up with such a code...
|