hey ya its working :) but whats the logic behind it?? On Thu, Jun 23, 2011 at 7:52 PM, Piyush Sinha <ecstasy.piy...@gmail.com>wrote:
> sorry by mistake i added it in scanf situation.. > actually this type of specifier can be used with printf statement for > finding the sum... > > look at the code below.... > > main() > { > int a=9; > int b=3; > printf("%d\n",printf("%*s%*s",a,"",b,"")); > system("pause"); > } > > On 6/23/11, Anika Jain <anika.jai...@gmail.com> wrote: > > thanx .. can u explain me how this is used in finding sum of 2 vars > without > > using + ?? > > > > > > On Thu, Jun 23, 2011 at 7:20 PM, Piyush Sinha > > <ecstasy.piy...@gmail.com>wrote: > > > >> An asterisk indicates that the data is to be retrieved from the use > >> but ignored, i.e. it is not stored in the corresponding > >> argument...hence the third value entered gets stored for b and for c > >> the output comes to garbage value.... > >> > >> One beautiful application of such type of implementation is in finding > >> the sum of 2 variables without using + operator..:) > >> > >> On 6/23/11, Anika Jain <anika.jai...@gmail.com> wrote: > >> > int main() > >> > { > >> > int a,b, c; > >> > scanf("%d%*d%d",&a,&b,&c); > >> > printf("%d %d %d",a,b,c); > >> > } > >> > > >> > output: 25 35 garbage > >> > > >> > how is it happening?? > >> > > >> > -- > >> > 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. > >> > > >> > > >> > >> > >> -- > >> *Piyush Sinha* > >> *IIIT, Allahabad* > >> *+91-8792136657* > >> *+91-7483122727* > >> *https://www.facebook.com/profile.php?id=100000655377926 * > >> > >> -- > >> 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. > > > > > > > -- > *Piyush Sinha* > *IIIT, Allahabad* > *+91-8792136657* > *+91-7483122727* > *https://www.facebook.com/profile.php?id=100000655377926 * > > -- > 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.