# Idiom #161 Multiply all the elements of a list

Multiply all the elements of the list elements by a constant c

`elements = elements.map((e) => e * c).toList();`
`elements = [for (var e in elements) e * c];`
`(map (partial * c) elements)`
```for (auto &it : elements)
it *= c;```
`#include <algorithm>`
```std::transform(std::begin(elements), std::end(elements), std::begin(elements), [c](auto i){
return i*c;
});```
`elements.Select(x => x*c)`
`elements[] *= c;`
`elements = Enum.map(elements, &(&1 * c))`
`elements = elements * c`
```for i := range elements {
elements[i] *= c
}```
`map (*c) elements`
`elements = elements.map(x => x * c)`
`import java.util.stream.Collectors;`
`elements.stream().map(e -> e*c).collect(Collectors.toList())`
```(mapcar (lambda (n) (* n c))
elements)```
```array_reduce(\$elements, function (\$result, \$e) {
return \$result * \$e;
}, 1);```
```for i := Low(elements) to High(elements) do
elements[i] := elements[i] * c;```
`@elements = map {\$_ * \$c} @elements;`
`elements = [c * x for x in elements]`
`elements.map { |el| el * c }`
`let elements = elements.into_iter().map(|x| c * x).collect::<Vec<_>>();`
`elements.map(_ * c)`

Bzzzzzzzzz