Answer :
Answer:
The answer to this question can be given as:
Code:
int k;
int incompletes[]={1,2,3,4,5,6,7,8,9};
int nIncompletes=9,studentID=9;
int numberOfIncompletes=0;
for (k=0; k<nIncompletes; k++)
{
if (incompletes[k] == studentID)
{
numberOfIncompletes++;
}
}
Explanation:
In the above code firstly we declare an integer variable that k, nIncompletes, studentID, numberOfIncompletes. In variable nIncompletes and studentID we assign value also. Then we declare an array incompletes[] in this array we initialized value. All the variable name is already given in the questions. Then we declare the for loop in the for loop we use the if conditional statement. In the if block we check the condition that is if incompletes array elements is equal to studentID then the numberOfIncompletes variable increase its value by 1.