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;
for i := range elements {
	elements[i] *= c
map (*c) elements
for i := Low(elements) to High(elements) do 
  elements[i] := elements[i] * c;
elements = map(lambda x: c*x, elements)
1!{|el| el * c }

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

Idiom created by