What’s the difference between an entry-condition loop and an exit-condition loop? Which kind is each of the C loops? Provide a detailed response with examples.

 

Write a for loop that prints the values 1 2 4 8 16 32 64 by increasing the value of a counting variable by a factor of two in each cycle.

 

Write a function that takes three arguments: a pointer to the first element of a range in an array, a pointer to the element following the end of a range in an array, and an int value. Have the function set each element of the array to the int value.

 

Write a void function called "swapPositive" which takes two reference parameters and swaps the values in those parameters if they are both positive numbers.    

 

 

Show how this function is called from a main() program.

    • 10 years ago
    CS263 - Final
    NOT RATED

    Purchase the answer to view it

    blurred-text
    • attachment
      final_exam.docx