A little help in arrays.

Hello, I want to ask if this statement is correct to test a specified index. My program is about computing grades and get an output if he's passed of fail.


for(s=0;s<=9;s++)

if (fg[s][3]>=93&&fg[s][3]<97)
cout<<"\t\t\t\t\t\t\t1.25\tPASSED\n";

for(s=0;s<=9;s++)

if (fg[s][3]>=89&&fg[s][3]<93)
cout<<"\t\t\t\t\t\t\t1.50\tPASSED\n";

for(s=0;s<=9;s++)

if (fg[s][3]>=85&&fg[s][3]<89)
cout<<"\t\t\t\t\t\t\t1.75\tPASSED\n";

for(s=0;s<=9;s++)

if (fg[s][3]>=82&&fg[s][3]<85)
gotoxy(55,12); cout<<"\t\t\t\t\t\t\t2.00\tPASSED\n";

for(s=0;s<=9;s++)

if (fg[s][3]>=79&&fg[s][3]<82)
cout<<"\t\t\t\t\t\t\t2.25\tPASSED\n";

for(s=0;s<=9;s++)

if (fg[s][3]>=76&&fg[s][3]<79)
cout<<"\t\t\t\t\t\t\t2.50\tPASSED\n";

for(s=0;s<=9;s++)

if (fg[s][3]>=73&&fg[s][3]<76)
cout<<"\t\t\t\t\t\t\t2.75\tPASSED\n";

for(s=0;s<=9;s++)

if (fg[s][3]>=70&&fg[s][3]<73)
cout<<"\t\t\t\t\t\t\t3.00\tPASSED\n";

for(s=0;s<=9;s++)

if (fg[s][3]>=65&&fg[s][3]<70)
cout<<"\t\t\t\t\t\t\tREMOVAL EXAM\n";

for(s=0;s<=9;s++)
if (fg[s][3]<65)
cout<<"\t\t\t\t\t\t\t5.00\tFAILED\n";
Yes, your method does work.
thank you stewbond :)
Topic archived. No new replies allowed.