Prime Numbers
Prime Number is a natural number greater than 1 that has exactly two different natural number divisors: 1 and itself. A natural number greater than 1 that is not a prime number is called a composite number. The smallest prime number is 2.
Make an app with app inventor to show a list of prime numbers up to 100. An example is as follows:
Thinking...
Declare two variables Dividend and Divisor.
Check the remainder = (Dividend % Divisor) is 0 or not. If remainder = 0 then Dividend is a prime number.
If Dividend=Divisor then Dividend is a prime number.
沒有留言:
張貼留言