Check If A Number Is Prime | C++ Example

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 ก.ย. 2024
  • Check if a number is prime or not using C++. Source code: github.com/por.... Check out www.portfolioc... to build a portfolio that will impress employers!

ความคิดเห็น • 17

  • @kevinchacon3852
    @kevinchacon3852 10 หลายเดือนก่อน +1

    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)”

  • @muxlisameliboyeva370
    @muxlisameliboyeva370 12 วันที่ผ่านมา

    Which IDE used in this code

  • @elonmusketeer139
    @elonmusketeer139 ปีที่แล้ว +1

    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!

    • @PortfolioCourses
      @PortfolioCourses  ปีที่แล้ว +1

      Not yet, but those are topics I absolutely want to cover. :-)

  • @saranathrajaram639
    @saranathrajaram639 หลายเดือนก่อน

    what IDE you using?

  • @patrickdo1904
    @patrickdo1904 3 หลายเดือนก่อน

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

    • @PortfolioCourses
      @PortfolioCourses  2 หลายเดือนก่อน

      You’re very welcome, I’m glad you found it straight forward! :-)

  • @therealgamer8150
    @therealgamer8150 ปีที่แล้ว +2

    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

  • @youzztv1533
    @youzztv1533 9 หลายเดือนก่อน

    Call i have all code

  • @MUHAMMADAWAIS-qt1td
    @MUHAMMADAWAIS-qt1td 7 หลายเดือนก่อน

    Can you name the compiler you are using ?

    • @PortfolioCourses
      @PortfolioCourses  7 หลายเดือนก่อน +1

      The IDE is Xcode on MacOS, I believe it uses the Clang compilers. :-)

    • @MUHAMMADAWAIS-qt1td
      @MUHAMMADAWAIS-qt1td 7 หลายเดือนก่อน

      @@PortfolioCourses Thanks :)

  • @Yvaine.e
    @Yvaine.e 8 หลายเดือนก่อน

    Tysm!

  • @soupman7545
    @soupman7545 11 หลายเดือนก่อน

    thank you

  • @hosams8083
    @hosams8083 6 หลายเดือนก่อน

    thanks