This language bar is your friend. Select your favorite languages!

Idiom #161 Multiply all the elements of a list

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

for (auto &it : elements)
	it *= c;
(map (partial * c) elements)
elements[] *= c;
elements = Enum.map(elements, &(&1 * c))
for i := range elements {
	elements[i] *= c
}
map (*c) elements
elements = elements.map(x => x * c)
for i := Low(elements) to High(elements) do 
  elements[i] := elements[i] * c;
elements = map(lambda x: c*x, elements)
elements.map!{|el| el * c }
let elements = elements.into_iter().map(|x| c * x).collect::<Vec<_>>();
elements = elements.map(_ * c)

Do you know the best way to do this in your language ?
New implementation...

Idiom created by

Bzzzzzzzzz