the reason for this is: we havent covered that in class. its INTRO to computer science, i have no clue what any of that is, just trying to make it work with what ive been given
Printable View
the reason for this is: we havent covered that in class. its INTRO to computer science, i have no clue what any of that is, just trying to make it work with what ive been given
What about my code don't you understand? I can explain how it works if you ask specifics.
ok, thanks. but thats not the point, I have to do it the way it is. I just need it to work.
thanks.
If you're one of those people who dislike break statements...
Could be...Code:for(i = 0;i < 5;++i)
{
if(!isdigit(fgetc(fp)))
{
valid = 0;
break;
}
}
Quzah.Code:for(i = 0;i < 5 && valid;++i)
{
if(!isdigit(fgetc(fp)))
{
valid = 0;
}
}
Hi,
I don't know if this will help but to print 5 digits, even with ints less than 10000, use :
int num = 0; // can be any number up to 99999
printf("\nThe number is %05d",num);