@Shady: You'll find the original question, and several responses, at http://groups.google.com/group/algogeeks/browse_thread/thread/0cfa6215ccf4b292#.
The code you referenced is not a correct solution. I think you'll find that my code is correct. Dave On Jul 15, 3:52 am, shady <[email protected]> wrote: > what is the question > ??????????????????????????????????????????????????????????????????????????????????????????????????????????? > > > > On Fri, Jul 15, 2011 at 2:16 PM, ani <[email protected]> wrote: > > #include<stdio.h> > > int main() > > { > > int a=1,k=2,n=3; > > int diff=n-k; > > if(diff>=0){ > > while(k>1) > > { > > k--; > > a=(a<<1) | 1; > > } > > while(diff>=1) > > { > > a=a<<1; > > diff--; > > } > > printf("%d",a); > > } > > else > > printf("value not applicable: %d",a); > > > return 0; > > } > > > -- > > You received this message because you are subscribed to the Google Groups > > "Algorithm Geeks" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]. > > For more options, visit this group at > >http://groups.google.com/group/algogeeks?hl=en.- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
