13,093,720 members (56,861 online)
Rate this:
See more:
How can i check that passed number is a calypso number or not

int isCalypso(int n)

Is there anyone who can tell me that any logic or help for that will be your kind enough for me
Posted 24-Sep-12 0:47am
OriginalGriff 24-Sep-12 7:24am

What have you tried?
Because we don't do your homework for you - we expect you to put some effort in!
usmanali.ali843 24-Sep-12 8:16am

if you can't help a stucking person to bring him out from any particular issue and not be able to give any helpful logic behind any problem then I haven't seen so dumb and dull and stupid person like you did because if you know any logic then that will be your honesty to tell to those who just stuck in that problem and don't disheart them. Remember these things. Hope you'll take care of these things next time

Rate this:

## Solution 1

If by "calypso number" you mean this then a naive implementation would be sometihng like:

```bool isCalypso(int n)
{
int pairCount=0;
for (int i = 2; i <= n/2 && pairCount < 2; i++){
if (isPrime(i) && isPrime(n-i) pairCount++;
}
return pairCount > 1;
}```
usmanali.ali843 24-Sep-12 8:17am

Thanks a lot to bring me out from this problem yeah i have done now what i wanna do thanks again.
sjelen 24-Sep-12 8:45am

If it helped, then mark it as solution.

Top Experts
Last 24hrsThis month
 OriginalGriff 289 Richard Deeming 198 Graeme_Grant 173 RickZeeland 170 Richard MacCutchan 120
 OriginalGriff 3,921 Graeme_Grant 2,192 ProgramFOX 2,017 ppolymorphe 1,686 Jochen Arndt 1,675