12,452,106 members (58,097 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
 Maciej Los 240 ppolymorphe 209 Richard MacCutchan 115 OriginalGriff 110 Dave Kreskowiak 90
 OriginalGriff 6,163 ppolymorphe 3,795 Karthik Bangalore 3,585 Maciej Los 3,180 Richard Deeming 2,835