Ask Question
17 September, 01:31

Given : an int variable k, an int array currentmembers that has been declared and initialized, an int variable nmembers that contains the number of elements in the array, an int variable memberid that has been initialized, and a bool variable isamember, write code that assigns true to isamember if the value of memberid can be found in currentmembers, and that assigns false to isamember otherwise. use only k, currentmembers, nmembers, and isamember.

+2
Answers (1)
  1. 17 September, 02:14
    0
    Isamember = false;

    for (k = 0; k < nmembers; k++)

    {

    if (memberid = = currentmembers[ k ])

    {

    isamember = true;

    break; / / your class may not be up to this, just delete it

    }

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Given : an int variable k, an int array currentmembers that has been declared and initialized, an int variable nmembers that contains the ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers