COMP2000 Assignment 1

$35.00

Download Details:

  • Name: COMP20002013-2014S2Assign1Numbers-n294mq.zip
  • Type: zip
  • Size: 5.99 KB

Category:

Description

5/5 - (1 vote)

Numbers

Write a program to read a positive integer n and determine whether it is prime or composite. If it is composite, print its prime factorization.
The following are some sample input and output.
Input Output
1021 prime
99 3 x 3 x 11
256 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2
7879 prime

As a reminder, data must be read from the file input.txt and output sent to the file output.txt.