Check If A Number Is Prime | C++ Example

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Oh my Lord, thank you much for the video. So intuitive and straight forward.

patrickdo
Автор

What if you wanted your output to also show all non-price numbers their divisors?
For example 6 so output would be “6 is not prime it’s divisors are (1 2 3)”

kevinchacon
Автор

Technically you only need to check if n is divisible by all the numbers between 1 and floor(sqrt(n)). And then even further, you only need to check the prime numbers in this range which can be a useful optimisation if you are calculating all the primes less than some value

therealgamer
Автор

Hi,
do you have any video that goes over system calls such as fork, exec, wait, and exit. More specifically, how to fork two child processes running the two programs generated in parallel?

Thanks!

elonmusketeer
Автор

Can you name the compiler you are using ?

MUHAMMADAWAIS-qttd