(a) (15%) Write a C# program that computes and prints out all prime numbers <200. Print these prime numbers 8 in a row.
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
(a) (15%) Write a C# program that computes and prints out all prime numbers <200. Print these prime numbers 8 in a row.
question, if I ask you to compute and print prime numbers less than 100, you'll print 2 3 5 7 11 13 17 19 in the first row, 23 29 31 37 41 43 47 53 in the second row etc; but if I ask you to compute the total number of prime numbers less than 100, then the total is 25 since there are 25 prime numbers from 2,3 up to 89, 97, less than 100
(a) (15%) Write a C# program that computes and prints out all prime numbers <200. Print these prime numbers 8 in a row. A prime number is a positive integer> 1 with 1 and itself as the only two divisors. So, 2, 3, 5, 7, 11, 13, 17, 19 are the first 8 prime integers. To compute prime numbers, you may use the % (modulo) operator. (b) (10%) Enhance your C# program to compute the total number of prime number less than 1000. You do not have to print out the prime numbers 8 in a row; just how many they are. To clarify this