code is below
int average(){ //method in class
int total = 0;
int NOS=5;
System.out.println("");
for(int i=0;i<10;i++){
if(ID ==" "){
NOS = i;
break;
}
total += mark;// total is the problem, tried printing it
// while thefor loop was running and at the end
// and its says "0" all the time why?
NOS++;
}
int avg = (total/NOS);
System.out.println(avg);
return avg;