Home > database >  Two return, how to determine which returns a value corresponding to a "is a prime number"
Two return, how to determine which returns a value corresponding to a "is a prime number"

Time:09-26

Can you help me have a look? Thank you for your

CodePudding user response:

This program problem forget to define a Boolean type data in advance?

CodePudding user response:

There is nothing wrong with this application is complete, ah,

2 to square number range:
With other number divisible, is not a prime number,
All can not be divisible, is a prime number,

CodePudding user response:

refer to the second floor of gypsy song response:
this program is very full, not trouble,

2 to square number range:
With other number divisible, is not a prime number,
All can not be divisible, is a prime number,

Well well, thank you, when I==0 x % have statements "return false" and "return true", then by calling the method the if (prime) (a), how will I know that it should the false of the corresponding output is "is not a prime number," (is to understand the prime judgment principle, but can't read this program)

CodePudding user response:

reference weixin_46025729 reply: 3/f
Quote: refer to the second floor of gypsy song response:
this program is very full, not trouble,

2 to square number range:
With other number divisible, is not a prime number,
All can not be divisible, is a prime number,

Well well, thank you, when I==0 x % have statements "return false" and "return true", then by calling the method the if (prime) (a), how will I know that it should the false of the corresponding output is "is not a prime number," (is to understand the prime judgment principle, but can't read this program)

Circulation within the scope of the number of all, if there is an aliquot, an immediate end to the cycle, and the function of the end, return false.

Cycle is completed, have no a aliquot to return true
  • Related