Question
A prime number is defined as any number that is only divisible by itself and 1. For instance the numbers 2, 17, and 53 are
A
prime number
is defined as any number that is only divisible by itself and 1. For instance the
numbers 2, 17, and 53 are all prime numbers. A
composite number
is simply defined as any number
that is not a prime number. For your program you will create a function called
isComposite
() which
takes an integer as an argument and returns a boolean value (
true
if the integer is composite and
false
if
otherwise.) As an example the following function call will return true:
isComposite(16)
Your program will then find
the first 100 composite numbers
and output the result to a file called
composite.txt
(with the
main
() function calling
isComposite
() in the process.)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started