1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Darya [45]
4 years ago
10

Write a program to check whether a number is circular number or not

Computers and Technology
1 answer:
steposvetlana [31]4 years ago
5 0
  public static int  circularLeftRotation(int num) { int unitDigit = num%10;  num = num/10; int temp = 1; while(num/temp != 0)  temp*=10; return num+unitDigit*temp;  }
public boolean isPrime(int num) {       if ( num < 2 ) return false;        for (int i = 2; i <= Math.sqrt(num); i++) {            if ( num % i == 0 ) {                return false;            }        }        return true; }
public int getDigitsCount(int number) {
int length = String.valueOf(number).length();    return length; }
public boolean isCircularPrime(int number) {               int temp = number;    while(isPrime(temp) && ((temp = circularLeftRotation(temp)) != number)); if(number == temp && isPrime(number)) { return true; } else return false; }                            public static void main(String[] args) {
System.out.println(new CircularPrime().getDigitsCount(113)); System.out.println(new CircularPrime().isPrime(113)); System.out.println(new CircularPrime().isCircularPrime(113));
}
}
You might be interested in
Susan needs to use a lookup function to find an exact match of an inventory item, so she will set the range_lookup value to ____
Hitman42 [59]
<span>Susan needs to use a lookup function to find an exact match of an inventory item, so she will set the range_lookup value to false. 

Thank you for posting your question here at brainly. I hope the answer will help you. Feel free to ask more questions here.
</span>
5 0
3 years ago
What can you find the under the privacy policy section of a shopping website?
masya89 [10]

The privacy policy will tell you what the site will do with your information.

7 0
3 years ago
Write a program to find the sum of given series: (a) S = 1 + (1/2) + (1/3) + ...... + (1/20)
Snowcat [4.5K]

total = 0

numerator = 1

denominator = 1

while denominator != 20:

   total += numerator/denominator

   denominator+=1

print(total)

I wrote my code in python 3.8. I hope this helps.

3 0
3 years ago
Type the numbers 1-50 and then type Computers and Technology twice type it once forward and once backwards.
Ierofanga [76]

Answer:

Why?

Explanation:

7 0
3 years ago
Read 2 more answers
Is the disk in the C: drive fixable or removable disk
katrin2010 [14]

Answer:

The disk is a removable disk.

8 0
4 years ago
Read 2 more answers
Other questions:
  • How long before a speech should you begin practicing?
    10·2 answers
  • _____ memory is a limited-capacity memory system in which information is usually retained for less than a minute unless strategi
    7·1 answer
  • What does Pentium means?:/
    7·2 answers
  • Arrange the binary number in increasing order of their arithmetic output in the decimal number system ?
    9·1 answer
  • What is the result of expression 15 &gt; 10 &gt; 5 in C? What is the result of the same expression in Java?
    14·1 answer
  • If I write too much for an exam answer, do I get downgraded?
    7·1 answer
  • Why won't my Brainly let me make an account? I have shut my computer down, closed the tab, and opened it, I have tried EVERYTHIN
    7·1 answer
  • Your ISP connects to the core routers of the Internet via a O backbone O satellite O cable mode Ospine​
    9·1 answer
  • A company is looking to share data between two platforms in order to extend their functionality. which feature enables communica
    8·1 answer
  • A palindrome is a string whose reversal is identical to the string. how many bit string of length 20 are palindromes and do not
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!