subject
Computers and Technology, 16.04.2020 01:24 Leffew

Set numMatches to the number of elements in userValues (having NUM_VALS elements) that equal matchValue. Ex: If matchValue = 2 and userVals = {2, 2, 1, 2}, then numMatches = 3.

#include

int main(void) {
const int NUM_VALS = 4;
int userValues[NUM_VALS];
int i = 0;
int matchValue = 0;
int numMatches = -99; // Set numMatches to 0 before your for loop

userValues[0] = 2;
userValues[1] = 2;
userValues[2] = 1;
userValues[3] = 2;

matchValue = 2;

/* Your solution goes here */

printf("matchValue: %d, numMatches: %d\n", matchValue, numMatches);

return 0;
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 16:30
Which type of computing device is best suited to having a digital pen as an input device? a. personal computer b. personal digital assistant c. smart television d. laptop e. mobile phone
Answers: 3
question
Computers and Technology, 22.06.2019 08:00
Apex q: what does a low employment rate indicate? a. not many people are earning high salaries b. not many people are going to college c. not many people are renting their homes d. not many people have jobs
Answers: 2
question
Computers and Technology, 22.06.2019 10:40
Nims is applicable to all stakeholders with incident related responsibilities. true or false
Answers: 1
question
Computers and Technology, 23.06.2019 01:00
Complete the sentence about a presentation delivery method
Answers: 2
You know the right answer?
Set numMatches to the number of elements in userValues (having NUM_VALS elements) that equal matchVa...
Questions
question
English, 25.09.2019 04:00
question
Mathematics, 25.09.2019 04:00
question
Biology, 25.09.2019 04:00
Questions on the website: 13722360