Kindly let me know Code for (a) Checking whether a number is a prime number or not, (b) to generate the first 10 prime numbers, (c) finding HCF of 3 numbers in C++ and a programme to print the first n number in the fibonacii series.

An early reply from members and techgurus are requested, pl.

Recommended Answers

Answered by Salem 5,138 in a post from

Kindly read the announcements before asking for someone to google for you.
http://www.daniweb.com/forums/announcement8-2.html

Jump to Post

All 2 Replies

There are lots of algorithms for finding prime numbers. The simplest and most crude would be to check every odd number up to 1/2 of the number.It works fine as long as you don't particularly care about performance.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.