Starting from:

$29.99

CSCI341 Assignment 1 Solution

For this assignment, your task is to print prime numbers from all positive integers entered by the user.
1. Prompt the user repeatedly to enter a positive integer N, until the user enters 0 (2 <= N <= 230). No number will be entered twice.
2. After the user enters 0 as the input, print only prime numbers from all entered integers.
There are no constraints for this assignment. The final output of the program should look like the following: The final output of the program should look like the following:
Enter a positive number (0 to quit): 3
Enter a positive number (0 to quit): 8
Enter a positive number (0 to quit): 29 Enter a positive number (0 to quit): 2
Enter a positive number (0 to quit): 13
Enter a positive number (0 to quit): 100
Enter a positive number (0 to quit): 4
Enter a positive number (0 to quit): 103
Enter a positive number (0 to quit): 0
List of prime numbers: 3 29 2 13 103
-- program is finished running --

Submit your source code (.asm file) to Canvas.

More products