Some questions on while loops

  1. What is wrong with the following loops?
    1. i = 4;
      
      while (i>3){
         printf("hi there");
         i++;
      }
      
    2. i = 3;
      
      while (i>3){
         printf("hi again");
         i--;
      }
      
  2. Write them into programs to test them.
Sample answers to these questions.

Back to notes on while loops.