you might get error: floating pointing formats not linked!! but thats obsolete! I don't compiler these days will give such an error otherwise code written by Dipankar will solve ur problem if u r unable to take multi-word input On Fri, Aug 5, 2011 at 7:24 PM, Dipankar Patro <dip10c...@gmail.com> wrote:
> try doing this way and tell if the program is working properly now: > for (i=0; i<3; i++) > { > scanf("%[^\n]", e[i].name); > scanf("%f", e[i].sal); > } > > There is always some problem in string input using %s, don't really know > why though deeply. > > On 5 August 2011 17:48, Vijay Khandar <vijaykhand...@gmail.com> wrote: > >> But program is not working properly........... >> >> >> On Fri, Aug 5, 2011 at 5:44 PM, Nikhil Gupta >> <nikhilgupta2...@gmail.com>wrote: >> >>> Couldn't find any error. >>> >>> On Fri, Aug 5, 2011 at 5:38 PM, Vijay Khandar >>> <vijaykhand...@gmail.com>wrote: >>> >>>> What errors are you likely to get when you run the following program? >>>> >>>> #include<stdio.h> >>>> #include<conio.h> >>>> #include<string.h> >>>> void main() >>>> { >>>> clrscr(); >>>> struct emp >>>> { >>>> char name[20]; >>>> float sal; >>>> }; >>>> struct emp e[10]; >>>> int i; >>>> for(i=0;i<=3;i++) >>>> scanf("%s %f",e[i].name,&e[i].sal); >>>> getch(); >>>> } >>>> >>>> Plz Explain anyone..................... >>>> >>>> Vijay...... >>>> >>>> -- >>>> 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. >>>> >>>> >>> >>> >>> -- >>> Nikhil Gupta >>> Senior Co-ordinator, Publicity >>> CSI, NSIT Students' Branch >>> NSIT, New Delhi, India >>> >>> -- >>> 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. >> > > > > -- > > ___________________________________________________________________________________________________________ > > Please do not print this e-mail until urgent requirement. Go Green!! > Save Papers <=> Save Trees > > -- > 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.