Oh right. I skimmed 2 & 3, and look hey they are. So you'll need the variables there. They still serve no purpose in options 4, 5, and 6.
Oh right. I skimmed 2 & 3, and look hey they are. So you'll need the variables there. They still serve no purpose in options 4, 5, and 6.
right they dont work for 4,5, and 6. But is there any way you can evaluate options 4,5, and 6 in the sample run, and figure out the essentials that i am missing if any to make them run smoothly? Thanks.
- Your for loops, as mentioned previously.
- Total_under needs to be initialized to 0.
- Your computation of the percentage is backwards (should be total_under * 100.0 / sum).
when you say my for loops are incorrect, and you mentioned them earlier, can you point me to where you are referring?
so should i initialize lowest = 0
and highest = size?
Let me show you what the loops for six should look like, since you don't seem to be grasping the last bit here:
Notice the complete absence of the words "lowest" and "highest".Code:if(option==6) { printf("What is the target donation?\n"); scanf("%d", &target_donation3); for(x = 0; x < count; x++) { sum += number[x]; if(total_under < target_donation3) { total_under+= number[x]; } }
oooo i see what you mean there. another question, are you running this in a windows native ide?
i dont know why but in a mac ide it just doesnt get passed the asking of the file name. So if you were to run it in a windows ide i just wanna see if its working.
Do you have
?Code:fscanf(fin, "%d", &size);
yea thats odd that you should say that cuz i just wrote in fin before, i noticed that it wasnt there
In addition, "%d " is a Bad Idea as far as fscanf goes, since if the last number doesn't have a carriage return or something after it, well....