I am working on a program that reads from a *.dat file while using functions as well. My programming teacher says it's against good etiquette to use an "if" statement with a "break". I have the function completely written and functional with the break statement:
I am not trying to get an easy grade for my class. I've read the rules and I understand the policy on homework. I've been struggling with a solution and I would appreciate some solutions to help me learn.Code:for (i = 0; i < MAX; i++) { scanf("%d", &ages[i]); if (ages[i] == 0) { break; } }