[algogeeks] Re: Lucky numbers

2009-01-07 Thread Miroslav Balaz
You should generate all the lucky numbers, less than 10^18, there shouldy not many of them. maybe 50. And then just submit program using hardwired array. 2009/1/6 Rahul Kushwaha > can anybody tell me which is best and correct solution > > On Tue, Jan 6, 2009 at 12:30 AM, Karthik Singaram Lakshma

[algogeeks] Re: Lucky numbers

2009-01-07 Thread Miroslav Balaz
ok that was bullshit, the number of lucky numbers is about 10^9 2009/1/7 Miroslav Balaz > You should generate all the lucky numbers, less than 10^18, there shouldy > not many of them. maybe 50. And then just submit program using hardwired > array. > > 2009/1/6 Rahul Kushwaha > > can anybody tel

[algogeeks] Re: find the output

2009-01-07 Thread Rahul Kushwaha
this code produces DANGLING REFERENCES coz buffer points to a location that does not exist \after execution of return statement... On Tue, Jan 6, 2009 at 2:48 AM, tania hamid wrote: > > > Plz indicate the output of the following code and explain why is it so.. > > > *char *modify (char *s) >

[algogeeks] Re: find the output

2009-01-07 Thread Pratyush Tewari
If you really want to print the buffer array outside the local scope the declare it using a static specifier.. eg...' #include char *modify (char *s) { #define MAX 15 static char buffer[MAX]; strcpy (buffer, s); buffer[0] = 'H'; return buffer; } int main () { printf ("hello!!!\n\n");

[algogeeks] Re: Lucky numbers

2009-01-07 Thread Rahul Kushwaha
can anybody tell me which is best and correct solution On Tue, Jan 6, 2009 at 12:30 AM, Karthik Singaram Lakshmanan < karthiksinga...@gmail.com> wrote: > > Its not clear that just a primality test would close the deal...The > sequence 1,3,7,13...does not have 5 which is prime. > If you consider a