Re: [algogeeks] what will be the output
@priya Because precedence of + operator is greater than "<<" operator . So evaluation of expression a <<2 + a will be a<<(a+2) On Sat, Feb 5, 2011 at 6:35 PM, priya mehta wrote: > sure thanks:) > > > > On Sat, Feb 5, 2011 at 6:26 PM, Gajendra Dadheech wrote: > >> @priya u seems to be a beginner in c programming... >> I would suggest u to go through Dennis richie. >> >> Thanks and regards, >> Gajendra Dadheech >> >> >> >> >> On Sat, Feb 5, 2011 at 2:53 PM, Manmeet Singh wrote: >> >>> because u not thinking of operator precedence :P :P >>> >>> >>> On Sat, Feb 5, 2011 at 2:52 PM, priya mehta wrote: >>> why is this happening? On Sat, Feb 5, 2011 at 2:51 PM, Manmeet Singh wrote: > 8, 32, 96 > > On Sat, Feb 5, 2011 at 2:46 PM, priya mehta > wrote: > >> #include >> #define PrintInt(expr) printf("%s : %d\n",#expr,(expr)) >> >> >> >> >> >> >> >> *int* FiveTimes(*int* a) >> { >> *int* t; >> >> >> >> >> >> >> >> t *=* a*<<*2 *+* a; >> >> >> >> >> >> >> >> *return* t; >> } >> >> *int* main() >> { >> *int* a *=* 1, b *=* 2,c *=* 3; >> >> >> >> >> >> >> >> PrintInt(FiveTimes(a)); >> PrintInt(FiveTimes(b)); >> >> >> >> >> >> >> >> PrintInt(FiveTimes(c)); >> *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 algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- > 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 group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. >>> >>> -- >>> 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 group, send email to >>> algogeeks+unsubscr...@googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >> >> -- >> 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 group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- > 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 group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Amazon interview quesiton
A special type of tree is given, where all leaf are marked with L and others are marked with N. every node can have 0 or at most 2 nodes. Trees preorder is given, create tree from that traversal. Thanks and regards, Gajendra Dadheech -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] interview quest..
can anyone help..? Suppose we have a string "RGBBGBGR". we have to eliminate the couple (two same chars adjacent to each other) recursively. For example RGBBGBGR --> RGGBGR-->RBGR -- balaji ;-) -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: kurukshetra...
max(a,b) = (abs(a+b)+abs(a-b))/2; Dave On Feb 5, 11:39 pm, Balaji S wrote: > can anyone tell how to evaluate max(a,b) using abs() function...?? > > -- > balaji ;-) -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] kurukshetra...
can anyone tell how to evaluate max(a,b) using abs() function...?? -- balaji ;-) -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks]
since comma operator has the lowest precedence of any C operator (y=1),024; thus y=1 On Feb 6, 10:18 am, Balaji S wrote: > well, i can understand how x gets 20...but how y becomes 1??? -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks]
well, i can understand how x gets 20...but how y becomes 1??? -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks]
The comma operator (represented by the token ,) is a binary operator that evaluates its first operand and discards the result, it then evaluates the second operand and returns this value (and type). The comma operator has the lowest precedence of any C operator, and acts as a sequence point. check this: http://geeksforgeeks.org/?p=8482 On Feb 6, 8:59 am, tech rascal wrote: > yeah, plz explain the effect/use of comma operator. > > > > > > > > On Sat, Feb 5, 2011 at 8:16 PM, nishaanth wrote: > > how does it ignore ' , ' for x but not for y ?. Can you explain what > > happens if u give , in an int. > > > On Sat, Feb 5, 2011 at 6:34 PM, Gajendra Dadheech > > wrote: > > >> x would be 20 as when we put zero in front of any number then this is > >> taken as octel number and value of 024 in decimal would be 20 > > >> Thanks and regards, > >> Gajendra Dadheech > > >> On Sat, Feb 5, 2011 at 6:30 PM, Gajendra Dadheech > >> wrote: > > >>> 20,1 this would be output > > >>> Thanks and regards, > >>> Gajendra Dadheech > >>> Software Engineer-I (R&D) > >>> > >>> MediaTek India Technology > >>> Work: 120-4343900(Ext. 276) > >>> Mobile: +91-9540646145 > >>> - > >>> "Be the change you want to see in the world" -Mohandas Gandhi > > >>> On Sat, Feb 5, 2011 at 6:11 PM, vaibhav agrawal > >>> wrote: > > @ankit: how x is 20? > > On Sat, Feb 5, 2011 at 4:46 PM, ankit sablok wrote: > > > x is 20 for sure and y i m guessing to be 1 comma operator and 0 used > > for octal constnts > > > On Sat, Feb 5, 2011 at 3:01 PM, radha krishnan < > > radhakrishnance...@gmail.com> wrote: > > >> guess the output > > >> main() > >> { > >> int x=(1,024),y; > >> y=1,024; > >> printf("%d %d",x,y); > >> } > > >> -- > >> 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 group, send email to > >> algogeeks+unsubscr...@googlegroups.com. > >> For more options, visit this group at > >>http://groups.google.com/group/algogeeks?hl=en. > > > -- > > 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 group, send email to > > algogeeks+unsubscr...@googlegroups.com. > > For more options, visit this group at > >http://groups.google.com/group/algogeeks?hl=en. > > -- > 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 group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > >> -- > >> 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 group, send email to > >> algogeeks+unsubscr...@googlegroups.com. > >> For more options, visit this group at > >>http://groups.google.com/group/algogeeks?hl=en. > > > -- > > S.Nishaanth, > > Computer Science and engineering, > > IIT Madras. > > > -- > > 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 group, send email to > > algogeeks+unsubscr...@googlegroups.com. > > For more options, visit this group at > >http://groups.google.com/group/algogeeks?hl=en. -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: c programming question
but can nybody explain why the output is coming like this on gcc compiler?? On Sun, Feb 6, 2011 at 10:04 AM, Manish Verma wrote: > > i think juver has explained > On Feb 5, 9:34 pm, jagannath prasad das wrote: > > @manish:can you explain with the example of a specific compiler... > > > > On Sat, Feb 5, 2011 at 10:02 PM, jagannath prasad das > > wrote: > > > > > > > > > @ankit:ans is 22 13 14 14 in gcc compiler. > > > > > On Sat, Feb 5, 2011 at 7:24 PM, Manish Verma >wrote: > > > > >> answer will depend on your compiler. > > > > >> On Feb 5, 1:02 am, jagannath prasad das wrote: > > >> > *#include > > >> > void main(void) > > >> > { > > >> > int a=10,b; > > >> > b=a++ + ++a; > > >> > printf("%d,%d,%d,%d",b,a++,a,++a); > > > > >> > } > > > > >> > *what is the answer?how are the function parameters passed on the > stack? > > > > >> -- > > >> 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 group, send email to > > >> algogeeks+unsubscr...@googlegroups.com > > > >> . > > >> For more options, visit this group at > > >>http://groups.google.com/group/algogeeks?hl=en. > > -- > 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 group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: c programming question
i think juver has explained On Feb 5, 9:34 pm, jagannath prasad das wrote: > @manish:can you explain with the example of a specific compiler... > > On Sat, Feb 5, 2011 at 10:02 PM, jagannath prasad das > wrote: > > > > > @ankit:ans is 22 13 14 14 in gcc compiler. > > > On Sat, Feb 5, 2011 at 7:24 PM, Manish Verma wrote: > > >> answer will depend on your compiler. > > >> On Feb 5, 1:02 am, jagannath prasad das wrote: > >> > *#include > >> > void main(void) > >> > { > >> > int a=10,b; > >> > b=a++ + ++a; > >> > printf("%d,%d,%d,%d",b,a++,a,++a); > > >> > } > > >> > *what is the answer?how are the function parameters passed on the stack? > > >> -- > >> 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 group, send email to > >> algogeeks+unsubscr...@googlegroups.com > >> . > >> For more options, visit this group at > >>http://groups.google.com/group/algogeeks?hl=en. -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks]
yeah, plz explain the effect/use of comma operator. On Sat, Feb 5, 2011 at 8:16 PM, nishaanth wrote: > how does it ignore ' , ' for x but not for y ?. Can you explain what > happens if u give , in an int. > > > On Sat, Feb 5, 2011 at 6:34 PM, Gajendra Dadheech wrote: > >> x would be 20 as when we put zero in front of any number then this is >> taken as octel number and value of 024 in decimal would be 20 >> >> >> Thanks and regards, >> Gajendra Dadheech >> >> >> >> >> On Sat, Feb 5, 2011 at 6:30 PM, Gajendra Dadheech wrote: >> >>> 20,1 this would be output >>> >>> Thanks and regards, >>> Gajendra Dadheech >>> Software Engineer-I (R&D) >>> >>> MediaTek India Technology >>> Work: 120-4343900(Ext. 276) >>> Mobile: +91-9540646145 >>> - >>> "Be the change you want to see in the world" -Mohandas Gandhi >>> >>> >>> >>> >>> On Sat, Feb 5, 2011 at 6:11 PM, vaibhav agrawal wrote: >>> @ankit: how x is 20? On Sat, Feb 5, 2011 at 4:46 PM, ankit sablok wrote: > x is 20 for sure and y i m guessing to be 1 comma operator and 0 used > for octal constnts > > > On Sat, Feb 5, 2011 at 3:01 PM, radha krishnan < > radhakrishnance...@gmail.com> wrote: > >> guess the output >> >> main() >> { >> int x=(1,024),y; >> y=1,024; >> printf("%d %d",x,y); >> } >> >> -- >> 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 group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> >> > -- > 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 group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. >>> >>> >> -- >> 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 group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > > > -- > S.Nishaanth, > Computer Science and engineering, > IIT Madras. > > -- > 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 group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: Good question
Hi Gajendra, See the following link http://geeksforgeeks.org/forum/topic/huwaei-interview-question-for-software-engineerdeveloper-2-5-years-about-cpuzzles#post-18725 On Feb 5, 7:28 pm, Gajendra Dadheech wrote: > Calculate size of a data type without using sizeof and without declaring any > variable of it > > Thanks and regards, > Gajendra Dadheech -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: Single Server Queue Simulation Program
Please ... On 4 fév, 21:17, Glauben wrote: > Hello , > who have single server queue simulation program c or c++ ? > Please > All the best . -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: c programming question
Suppose we have the following statement: f(a) + f(b). The order of evaluating the operads is compiler-dependent. So, on compiler1 f(b) can be calculated first, f(a) at the final step. -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: codechef problem
@Dave We may use fractions instead of pure double values. -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: c programming question
@manish:can you explain with the example of a specific compiler... On Sat, Feb 5, 2011 at 10:02 PM, jagannath prasad das wrote: > @ankit:ans is 22 13 14 14 in gcc compiler. > > > On Sat, Feb 5, 2011 at 7:24 PM, Manish Verma wrote: > >> answer will depend on your compiler. >> >> On Feb 5, 1:02 am, jagannath prasad das wrote: >> > *#include >> > void main(void) >> > { >> > int a=10,b; >> > b=a++ + ++a; >> > printf("%d,%d,%d,%d",b,a++,a,++a); >> > >> > } >> > >> > *what is the answer?how are the function parameters passed on the stack? >> >> -- >> 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 group, send email to >> algogeeks+unsubscr...@googlegroups.com >> . >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> >> > -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: c programming question
@ankit:ans is 22 13 14 14 in gcc compiler. On Sat, Feb 5, 2011 at 7:24 PM, Manish Verma wrote: > answer will depend on your compiler. > > On Feb 5, 1:02 am, jagannath prasad das wrote: > > *#include > > void main(void) > > { > > int a=10,b; > > b=a++ + ++a; > > printf("%d,%d,%d,%d",b,a++,a,++a); > > > > } > > > > *what is the answer?how are the function parameters passed on the stack? > > -- > 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 group, send email to > algogeeks+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Spoj Problem : Small Factorials
#include long int k; void fact(long int a[],long int n) { long int c=0,temp,i=0; while(i<=k) { temp=a[i]*n+c; a[i]=temp%10; c=temp/10; i++; } while(c!=0) { a[i]=c%10; c=c/10; k++; i++; } } main() { long int t,i,n,a[200]; scanf("%ld",&t); while(t) { scanf("%ld",&n); k=0; i=2; a[0]=1; for(i=2;i<=n;i++) { fact(a,i); } for(i=k;i>=0;i--) { printf("%ld",a[i]); } printf("\n"); t--; } 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 algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks]
how does it ignore ' , ' for x but not for y ?. Can you explain what happens if u give , in an int. On Sat, Feb 5, 2011 at 6:34 PM, Gajendra Dadheech wrote: > x would be 20 as when we put zero in front of any number then this is taken > as octel number and value of 024 in decimal would be 20 > > > Thanks and regards, > Gajendra Dadheech > > > > > On Sat, Feb 5, 2011 at 6:30 PM, Gajendra Dadheech wrote: > >> 20,1 this would be output >> >> Thanks and regards, >> Gajendra Dadheech >> Software Engineer-I (R&D) >> >> MediaTek India Technology >> Work: 120-4343900(Ext. 276) >> Mobile: +91-9540646145 >> - >> "Be the change you want to see in the world" -Mohandas Gandhi >> >> >> >> >> On Sat, Feb 5, 2011 at 6:11 PM, vaibhav agrawal wrote: >> >>> @ankit: how x is 20? >>> >>> >>> On Sat, Feb 5, 2011 at 4:46 PM, ankit sablok wrote: >>> x is 20 for sure and y i m guessing to be 1 comma operator and 0 used for octal constnts On Sat, Feb 5, 2011 at 3:01 PM, radha krishnan < radhakrishnance...@gmail.com> wrote: > guess the output > > main() > { > int x=(1,024),y; > y=1,024; > printf("%d %d",x,y); > } > > -- > 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 group, send email to > algogeeks+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. >>> >>> -- >>> 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 group, send email to >>> algogeeks+unsubscr...@googlegroups.com >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >> >> > -- > 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 group, send email to > algogeeks+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- S.Nishaanth, Computer Science and engineering, IIT Madras. -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Good question
Calculate size of a data type without using sizeof and without declaring any variable of it Thanks and regards, Gajendra Dadheech -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: c programming question
answer will depend on your compiler. On Feb 5, 1:02 am, jagannath prasad das wrote: > *#include > void main(void) > { > int a=10,b; > b=a++ + ++a; > printf("%d,%d,%d,%d",b,a++,a,++a); > > } > > *what is the answer?how are the function parameters passed on the stack? -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] what will be the output
sure thanks:) On Sat, Feb 5, 2011 at 6:26 PM, Gajendra Dadheech wrote: > @priya u seems to be a beginner in c programming... > I would suggest u to go through Dennis richie. > > Thanks and regards, > Gajendra Dadheech > > > > > On Sat, Feb 5, 2011 at 2:53 PM, Manmeet Singh wrote: > >> because u not thinking of operator precedence :P :P >> >> >> On Sat, Feb 5, 2011 at 2:52 PM, priya mehta wrote: >> >>> why is this happening? >>> >>> >>> >>> On Sat, Feb 5, 2011 at 2:51 PM, Manmeet Singh wrote: >>> 8, 32, 96 On Sat, Feb 5, 2011 at 2:46 PM, priya mehta wrote: > #include > #define PrintInt(expr) printf("%s : %d\n",#expr,(expr)) > > > > > > > *int* FiveTimes(*int* a) > { > *int* t; > > > > > > > t *=* a*<<*2 *+* a; > > > > > > > *return* t; > } > > *int* main() > { > *int* a *=* 1, b *=* 2,c *=* 3; > > > > > > > PrintInt(FiveTimes(a)); > PrintInt(FiveTimes(b)); > > > > > > > PrintInt(FiveTimes(c)); > *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 algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. >>> >>> -- >>> 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 group, send email to >>> algogeeks+unsubscr...@googlegroups.com >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >> >> -- >> 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 group, send email to >> algogeeks+unsubscr...@googlegroups.com >> . >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- > 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 group, send email to > algogeeks+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks]
x would be 20 as when we put zero in front of any number then this is taken as octel number and value of 024 in decimal would be 20 Thanks and regards, Gajendra Dadheech On Sat, Feb 5, 2011 at 6:30 PM, Gajendra Dadheech wrote: > 20,1 this would be output > > Thanks and regards, > Gajendra Dadheech > Software Engineer-I (R&D) > > MediaTek India Technology > Work: 120-4343900(Ext. 276) > Mobile: +91-9540646145 > - > "Be the change you want to see in the world" -Mohandas Gandhi > > > > > On Sat, Feb 5, 2011 at 6:11 PM, vaibhav agrawal wrote: > >> @ankit: how x is 20? >> >> >> On Sat, Feb 5, 2011 at 4:46 PM, ankit sablok wrote: >> >>> x is 20 for sure and y i m guessing to be 1 comma operator and 0 used for >>> octal constnts >>> >>> >>> On Sat, Feb 5, 2011 at 3:01 PM, radha krishnan < >>> radhakrishnance...@gmail.com> wrote: >>> guess the output main() { int x=(1,024),y; y=1,024; printf("%d %d",x,y); } -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. >>> -- >>> 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 group, send email to >>> algogeeks+unsubscr...@googlegroups.com >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >> >> -- >> 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 group, send email to >> algogeeks+unsubscr...@googlegroups.com >> . >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks]
20,1 this would be output Thanks and regards, Gajendra Dadheech Software Engineer-I (R&D) MediaTek India Technology Work: 120-4343900(Ext. 276) Mobile: +91-9540646145 - "Be the change you want to see in the world" -Mohandas Gandhi On Sat, Feb 5, 2011 at 6:11 PM, vaibhav agrawal wrote: > @ankit: how x is 20? > > > On Sat, Feb 5, 2011 at 4:46 PM, ankit sablok wrote: > >> x is 20 for sure and y i m guessing to be 1 comma operator and 0 used for >> octal constnts >> >> >> On Sat, Feb 5, 2011 at 3:01 PM, radha krishnan < >> radhakrishnance...@gmail.com> wrote: >> >>> guess the output >>> >>> main() >>> { >>> int x=(1,024),y; >>> y=1,024; >>> printf("%d %d",x,y); >>> } >>> >>> -- >>> 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 group, send email to >>> algogeeks+unsubscr...@googlegroups.com >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >>> >> -- >> 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 group, send email to >> algogeeks+unsubscr...@googlegroups.com >> . >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- > 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 group, send email to > algogeeks+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] what will be the output
@priya u seems to be a beginner in c programming... I would suggest u to go through Dennis richie. Thanks and regards, Gajendra Dadheech On Sat, Feb 5, 2011 at 2:53 PM, Manmeet Singh wrote: > because u not thinking of operator precedence :P :P > > > On Sat, Feb 5, 2011 at 2:52 PM, priya mehta wrote: > >> why is this happening? >> >> >> >> On Sat, Feb 5, 2011 at 2:51 PM, Manmeet Singh wrote: >> >>> 8, 32, 96 >>> >>> On Sat, Feb 5, 2011 at 2:46 PM, priya mehta wrote: >>> #include #define PrintInt(expr) printf("%s : %d\n",#expr,(expr)) *int* FiveTimes(*int* a) { *int* t; t *=* a*<<*2 *+* a; *return* t; } *int* main() { *int* a *=* 1, b *=* 2,c *=* 3; PrintInt(FiveTimes(a)); PrintInt(FiveTimes(b)); PrintInt(FiveTimes(c)); *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 algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. >>> >>> -- >>> 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 group, send email to >>> algogeeks+unsubscr...@googlegroups.com >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >> >> -- >> 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 group, send email to >> algogeeks+unsubscr...@googlegroups.com >> . >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- > 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 group, send email to > algogeeks+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks]
@ankit: how x is 20? On Sat, Feb 5, 2011 at 4:46 PM, ankit sablok wrote: > x is 20 for sure and y i m guessing to be 1 comma operator and 0 used for > octal constnts > > > On Sat, Feb 5, 2011 at 3:01 PM, radha krishnan < > radhakrishnance...@gmail.com> wrote: > >> guess the output >> >> main() >> { >> int x=(1,024),y; >> y=1,024; >> printf("%d %d",x,y); >> } >> >> -- >> 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 group, send email to >> algogeeks+unsubscr...@googlegroups.com >> . >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> >> > -- > 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 group, send email to > algogeeks+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks]
x is 20 for sure and y i m guessing to be 1 comma operator and 0 used for octal constnts On Sat, Feb 5, 2011 at 3:01 PM, radha krishnan wrote: > guess the output > > main() > { > int x=(1,024),y; > y=1,024; > printf("%d %d",x,y); > } > > -- > 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 group, send email to > algogeeks+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks]
guess the output main() { int x=(1,024),y; y=1,024; printf("%d %d",x,y); } -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] what will be the output
because u not thinking of operator precedence :P :P On Sat, Feb 5, 2011 at 2:52 PM, priya mehta wrote: > why is this happening? > > > > On Sat, Feb 5, 2011 at 2:51 PM, Manmeet Singh wrote: > >> 8, 32, 96 >> >> On Sat, Feb 5, 2011 at 2:46 PM, priya mehta wrote: >> >>> #include >>> #define PrintInt(expr) printf("%s : %d\n",#expr,(expr)) >>> >>> >>> >>> *int* FiveTimes(*int* a) >>> { >>> *int* t; >>> >>> >>> >>> t *=* a*<<*2 *+* a; >>> >>> >>> >>> *return* t; >>> } >>> >>> *int* main() >>> { >>> *int* a *=* 1, b *=* 2,c *=* 3; >>> >>> >>> >>> PrintInt(FiveTimes(a)); >>> PrintInt(FiveTimes(b)); >>> >>> >>> >>> PrintInt(FiveTimes(c)); >>> *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 algogeeks@googlegroups.com. >>> To unsubscribe from this group, send email to >>> algogeeks+unsubscr...@googlegroups.com >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >> >> -- >> 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 group, send email to >> algogeeks+unsubscr...@googlegroups.com >> . >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- > 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 group, send email to > algogeeks+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] what will be the output
why is this happening? On Sat, Feb 5, 2011 at 2:51 PM, Manmeet Singh wrote: > 8, 32, 96 > > On Sat, Feb 5, 2011 at 2:46 PM, priya mehta wrote: > >> #include >> #define PrintInt(expr) printf("%s : %d\n",#expr,(expr)) >> >> >> *int* FiveTimes(*int* a) >> { >> *int* t; >> >> >> t *=* a*<<*2 *+* a; >> >> >> *return* t; >> } >> >> *int* main() >> { >> *int* a *=* 1, b *=* 2,c *=* 3; >> >> >> PrintInt(FiveTimes(a)); >> PrintInt(FiveTimes(b)); >> >> >> PrintInt(FiveTimes(c)); >> *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 algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com >> . >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- > 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 group, send email to > algogeeks+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] what will be the output
8, 32, 96 On Sat, Feb 5, 2011 at 2:46 PM, priya mehta wrote: > #include > #define PrintInt(expr) printf("%s : %d\n",#expr,(expr)) > > *int* FiveTimes(*int* a) > { > *int* t; > > t *=* a*<<*2 *+* a; > > *return* t; > } > > *int* main() > { > *int* a *=* 1, b *=* 2,c *=* 3; > > PrintInt(FiveTimes(a)); > PrintInt(FiveTimes(b)); > > PrintInt(FiveTimes(c)); > *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 algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- 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 group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] what will be the output
#include #define PrintInt(expr) printf("%s : %d\n",#expr,(expr)) *int* FiveTimes(*int* a) { *int* t; t *=* a*<<*2 *+* a; *return* t; } *int* main() { *int* a *=* 1, b *=* 2,c *=* 3; PrintInt(FiveTimes(a)); PrintInt(FiveTimes(b)); PrintInt(FiveTimes(c)); *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 algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.