NAME

Question types


Start with


Question limit

of 13 available terms

Print test

13 Multiple choice questions

  1. Simply allow for executing a block of code without providing any construct for keeping a counter.
  2. The conditional expression.
  3. The code within the block will always be evaluated once before the condition is reached.
    This is why it is used.


    #include <stdio.h>

    int main()
    {
    char letters[] = {'a','b','c'};
    int w = 0;
    do
    {
    printf("letter %d is %c \n", w, letters[w]);
    } while (w<4);

    return 0;
    }
  4. do-until loop
  5. The variable is not auto incremented, so it repeatedly traverses the same index value in the array.


    #include <stdio.h>

    int main()
    {
    char letters[] = {'a','b','c'};
    int w = 0;
    do
    {
    printf("letter %d is %c \n", w, letters[w]);
    ++w; }
    while (w<4);

    return 0;
    }
  6. It is easy to make the common error of the "infinite death loop".
  7. letters[1];
  8. for ( int = 0 ; i < 5; i++ ) {}
  9. It is a construct that allows you to repeatedly execute a block of code.
  10. Infinite because it neglects the auto incrementation of the variable within the conditional expression.
  11. No it is not. The for loop and while loop are used for when you want to traverse arrays or do any other type of looping.
  12. once
  13. The for loop has three statements within the set of parentheses.
    a. First we are initializing an integer variable "i" to "0"
    b. Second a Boolean expression which "i", to the number of items in the array (3).
    c. Thirdly we are auto incrementing "i" if the value of the index is <12.

    (i) Then within the code block {} we are incrementally summing the values that are in the array "even".

    (ii) w/in the block we are indexing the variables using the variable "i".