Thanks for replying..
I don't think I got you correctly... I'm not familiar with fgets() and
strtol(). I tried replacing the "scanf("%c",&another);" with "another
= getchar();". The program still behaves in the same way. :(
--- In [email protected], andrew clarke <[EMAIL PROTECTED]> wrote:
>
> On Fri, Aug 18, 2006 at 07:49:49AM -0000, Kishan Tikandar wrote:
>
> > I'm trying to create a program for calculate grace marks for a student
> > based on certain rules. The logic works fine but it is not looping as
> > I want it to.
> >
> > I want this program to prompt me whether i wish to "check for another
> > student" but it just executes for one time and end.
>
> > printf("\nEnter the class obtained by the student:");
> > scanf("%d",&clas);
>
> scanf() can be unpredictable and difficult to work with. I would use
> fgets() then strtol() instead.
>
> > scanf("%c",&another);
>
> Here I would use
>
> another = getchar();
>
To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/c-prog/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/