yes, try changing %f to %d somewhere, answers will come right , but can anyone epalin the reason that if garbage values were to be printed , i am having same garbage values on my machine as on his :P. How is that answers and output comes out to be same
On Sat, Jul 23, 2011 at 12:56 AM, rajeev bharshetty <[email protected]>wrote: > I think when the mismatch of the format specifier and the variable occurs , > the compiler generates random number output as, some garbage I suppose . > > > On Sat, Jul 23, 2011 at 12:30 AM, geek forgeek <[email protected]>wrote: > >> #include<stdio.h> >> void main() >> { >> int x; >> float t; >> scanf("%f",&t); >> printf("%f\n",t); >> x=90; >> printf("%f\n",x); >> { >> x=1; >> printf("%f\n",x); >> { >> x=30; >> printf("%f\n",x); >> } >> printf("%f\n",x); >> } >> x==9; >> printf("%f\n",x); >> } >> >> input >> 1.1 >> >> output >> 1.100000 >> 1.099999 >> 1.099999 >> 1.099999 >> 1.099999 >> 1.099999 >> >> -- >> 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. >> > > > > -- > Regards > Rajeev N B <http://www.opensourcemania.co.cc> > > > -- > 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. > -- Ankur Khurana Computer Science Netaji Subhas Institute Of Technology Delhi. -- 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.
