Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
1.00/5 (5 votes)
See more:
A number is prime if its only divisors are 1 and itself. All non-prime numbers less than 100 will have a divisor between 2 and 10. In view of the above statements, write a C program which computes all the prime numbers less than 100. Explain your work with the help of individual flow charts in addition to C code.
Posted
Updated 16-Jun-11 1:22am
v2
Comments
Wayne Gaylard 16-Jun-11 7:22am    
Seriously chap, I recommend you do your own homework. If you don't understand anything ask your tutor.
tolw 16-Jun-11 7:23am    
Marked as gimmecode. You realy should at least try before asking...
CPallini 16-Jun-11 7:54am    
Thank you for the precious info provided. Now, please, try yourlself to write down the program instead of wander around here...

All right, let's assume you really ABSOLUTELY have no idea on how to do your homework. I'll give you a hint on algorithm (no code, though, as this is something you really must do by yourself) then. You could use Sieve of Eratosthenes algorhthm
 
Share this answer
 
Comments
[no name] 16-Jun-11 20:48pm    
dfsadadas
It does not work like this here.
I am sorry but there is no quick question here. This sounds like your college project/assignment, you should put some effort.

We expect you to put some time in trying the issue that you are facing and then some time in formulating the question while posting here.

Here is what is expected by enquirers:
1. TRY first what you want to do!
2. Formulate what was done by you that looks like an issue/not working.

Try them and tell if you face issues.
Members will be more than happy to help like this.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 16-Jun-11 13:48pm    
Well, this is your usual response, my 5.
Please see mine. I look at this from a bit different point of view.
--SA
I don't think anyone is interested to solve this trivial and boring problem for you. Yes, it is trivial.

Moreover, you are not interested in someone doing it for your. You really need to do all your school assignments by yourself — is will pay off very well in near future. If you don't you loose too many chances to learn something. If you are not deeply interested in learning, this profession (and any other creative work) is not for you.

—SA
 
Share this answer
 
v2
Comments
Sandeep Mewara 16-Jun-11 14:03pm    
Sure, does make sense. my 5 too!
Sergey Alexandrovich Kryukov 16-Jun-11 14:33pm    
Thank you, Sandeep.
In this way, we're probably not going to look at those few lines of code here at CodeProject. :-)
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900