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.

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, networking, learning, and sharing knowledge.