To replace all the occurrences of the number n with 0 in the given array | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

To replace all the occurrences of the number n with 0 in the given array

a problem using function

22nd Nov 2016, 5:27 PM
Hari Haralan
Hari Haralan - avatar
1 Answer
+ 1
for (int i = 0; i < len(array); i++) { if array[i] = n { array[i] = 0; } }
26th Nov 2016, 7:58 PM
Jay Welborn
Jay Welborn - avatar