[algogeeks] c output

2011-08-02 Thread Radhika Renganathan
can someone explain the output of following program? #includestdio.h main(){char *p=hai friends,*p1; p1=p;while(*p!='\0') ++*p++;printf(%s,p1);} i got run time error in gcc.. -- radhika .. :) -- You received this message because you are subscribed to the Google Groups Algorithm

Re: [algogeeks] c output

2011-08-02 Thread Radhika Renganathan
thks ravinder.. ! char p[]=hi char *p = hi are both string constants? On Wed, Aug 3, 2011 at 2:08 AM, Ravinder Kumar ravinde...@gmail.com wrote: ++*p++ This statement changing the value of read only memory of string constant *p=hai friends ; -- *With Regards :* Ravinder Kumar

[algogeeks] c-aps

2011-08-01 Thread Radhika Renganathan
HI, I'm seeking for a source for learning c-aps and i don get any valuable ones. Can anyone plz suggest me or share the valuable sources u know. Thank u in anticipation -- radhika .. :) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To

[algogeeks] Re: c-aps

2011-08-01 Thread Radhika Renganathan
also please suggest special pointer based output c-aps.. On Mon, Aug 1, 2011 at 9:57 PM, Radhika Renganathan radi.coo...@gmail.comwrote: HI, I'm seeking for a source for learning c-aps and i don get any valuable ones. Can anyone plz suggest me or share the valuable sources u know. Thank u

[algogeeks] MS: Testing

2011-07-21 Thread Radhika Renganathan
Write test cases for a program which finds the next palindromic date given a date. -- radhika .. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this

Re: [algogeeks] Microsoft Interview Qn - Looping

2011-07-19 Thread Radhika Renganathan
i know 3 solns! 1) int n = 20; int i; for (i=0; i+n; i--) printf(MS); 2) int n = 20; int i; for (i=0; in; n--) printf(MS); 3) int n = 20; int i; for (i=0; -in; i--) printf(MS); On Tue, Jul 19, 2011 at 10:27 PM, Reynald reynaldsus...@gmail.com wrote: Given the

Re: [algogeeks] Minimum draws for correct labels

2011-06-20 Thread Radhika Renganathan
one drawing ?! On 6/21/11, Navneet Gupta navneetn...@gmail.com wrote: IMAGINE THAT YOU have three boxes, one containing two black marbles, one containing two white marbles, and the third, one black marble and one white marble. The boxes were labeled for their contents-BB, WW and BW-but

Re: [algogeeks] Re: SPOJ THRBL

2011-06-11 Thread Radhika Renganathan
i did the same prob wit range maximum query.. but im repeatedly getting wrong answer.. im stuck with this prob for a long time.. pls help.. my code: #includeiostream using namespace std; #includestdlib.h #includestdio.h int A[50010]; int M[999]; void initialize(int node, int b, int e) {

Re: [algogeeks] Re: SPOJ THRBL

2011-06-11 Thread Radhika Renganathan
yea.. now got ac.. :) mistake was k==y is also possible but xk fails.. so got WA .. thank u :) On Sat, Jun 11, 2011 at 2:39 PM, keyan karthi keyankarthi1...@gmail.comwrote: k=query(x,y-1) if(k==x) count++ with this change ur code ACs :) On Sat, Jun 11, 2011 at 1:24 PM, Radhika Renganathan

Re: [algogeeks] Re: SPOJ THRBL

2011-06-11 Thread Radhika Renganathan
im sorry .. yk fails :D On 6/11/11, Radhika Renganathan radi.coo...@gmail.com wrote: yea.. now got ac.. :) mistake was k==y is also possible but xk fails.. so got WA .. thank u :) On Sat, Jun 11, 2011 at 2:39 PM, keyan karthi keyankarthi1...@gmail.comwrote: k=query(x,y-1) if(k==x) count

Re: [algogeeks] Print 1 to n without loops

2011-06-10 Thread Radhika Renganathan
we can declare a class with construction printing value class A { private: static int i; public: A() { cout++i endl; } }; A::i=0; main() { int n=5; A ob[n]; } this will print from 1 to 5 am i right? On Fri, Jun 10, 2011 at 9:30 PM, Navneet Gupta navneetn...@gmail.comwrote: Using recursion

Re: [algogeeks] Print 1 to n without loops

2011-06-10 Thread Radhika Renganathan
sorry i meant 'constructor' ! On Fri, Jun 10, 2011 at 9:40 PM, Radhika Renganathan radi.coo...@gmail.comwrote: we can declare a class with construction printing value class A { private: static int i; public: A() { cout++i endl; } }; A::i=0; main() { int n=5; A ob[n