Saturday, September 22, 2012

C++ PROGRAM TO CHECK WHETHER A NUMBER IS CIRCULAR PRIME OR NOT

The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime.

5 comments:

  1. Prime number program in C++

    prime number is only divisible by 1 and itself,
    we can easily write prime number program in c++, just check number is not divisible by any other numbers except 1 and number itself.

    ReplyDelete
  2. can you write the program with using only while loop?

    ReplyDelete
  3. A prime number is a whole number greater than 1, which is only divisible by 1 and itself. First few prime numbers are : 2 3 5 7 11 13 17 19 23
    2 is the only even Prime number. Prime number program in C++. Every prime number can represented in form of 6n+1 or 6n-1, where n is natural number. 2, 3 are only two consecutive natural numbers which are prime too.

    ReplyDelete