1. Engineering
  2. Computer Science
  3. write a c program that finds the positions of the...

Question: write a c program that finds the positions of the...

Question details

Write a C program that finds the positions of the first two zeros of an input array, and it should set all of the intervening values (if any) to zero. If the array only contains one zero, if it contains no zeros, or if the first two zeros are right next to each other, the program should NOT modify the array. As part of the solution, write and call the function setZeros() with the following prototype. n is the size of the array. In writing function setZeros(), you may include calls to function findZero(int a[], int n, int pos). Name your program set0s.c

void setZeros(int a[], int n);

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution