HW010
Math 2984 - Fall 2017
Intro to Mathematical Problem Solving


TASK: Print the first 100 prime numbers, using WHILE.


COMMENT: MATLAB has a built-in function "tf = isprime(n)" which will return a value of "true" if the integer "n" is a prime number.


INSTRUCTIONS:

        A for() loop is the wrong kind of loop for this problem!

        Use a simple name like "i" to count how many primes you have
        found so far.  You should start i at 0; you need to increase
        i by 1 every time you find a prime.  You keep searching WHILE
        i is less than 100.

        Also, before you start your loop, you need to define a variable
        that represents the integer to be checked.  The simple name
        "n" would be suitable for this, and you should start this value
        at 1.

        While you haven't found 100 prime numbers yet 
          check whether n is prime.
          if n is prime, increate i by 1.
          increase n by 1.
        End of loop.
      
If you are doing things correctly, the 10-th prime number should be 29.


SUBMIT: Your work should be stored in a script file called "hw010.m". Your script file should begin with at least three comment lines:

        % hw010.m
        % YOUR NAME
        % This script (describe what it does)
        % Add any comments here that you care to make.
      
If this problem is part of an assignment, then submit it to Canvas.