I need to write a main() function, that loops over a bunch of
numbers from 0 to 100, calls another function called isPrime() for each of them, and print out the numbers that are prime.
I'm new to C++ and any help would be appreciated.
forumposters
0
Light Poster
Recommended Answers
Jump to Post>I'm new to C++ and any help would be appreciated.
At least start trying to solve your problem before asking for help. It makes us like you more and ignore you less.
Jump to PostWhat narue said applies. But I'll help you a little: isPrime(int x)
Jump to PostYou've been around over a year and haven't read the Rules yet? You also need to read this. It will explain that you need to tell us what problem you are having so we don't have to guess -- among other things
Jump to Post>Here's what I've come up with so far
Somehow I find it hard to believe that you can write IsPrime but not the main driver to print the primes in the range [0..100). I'm guessing you were given IsPrime and told to write main, which means you've come up with …
All 16 Replies
Narue
5,707
Bad Cop
Team Colleague
sillyboy
43
Practically a Master Poster
forumposters
0
Light Poster
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
Narue
5,707
Bad Cop
Team Colleague
JRM
107
Practically a Master Poster
soeja
0
Newbie Poster
soeja
0
Newbie Poster
parameshyss
0
Newbie Poster
hvengel
0
Newbie Poster
parameshyss
0
Newbie Poster
StuXYZ
731
Practically a Master Poster
pseudorandom21
166
Practically a Posting Shark
hvengel
0
Newbie Poster
pseudorandom21
166
Practically a Posting Shark
yashsaxena
-1
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.