View Single Post
Old 03-12-2005, 11:27 PM   #1 (permalink)
mohsh2002
 
Newb Techie

Join Date: Jan 2005

Posts: 20

mohsh2002

Default using nested for loop

i have to wirite a C program that display the average of some test results for four experiments, each experiment has test results. They are giving me the results . i have to use nested for loop ..

this is what i did so far

#include<stdio.h>

int main()

{

float total,exp1,exp2,exp3,exp4,avg,counter;

counter = 0;
total = 0;
exp1=23.2+31.5+16.9+27.5+25.4+28.6;
exp2=34.8+45.2+27.9+36.8+33.4+39.4;
exp3= 19.4+16.8+10.2+20.8+18.9+13.4;
exp4=36.9+39.5+49.2+45.1+42.7+50.6;

for ( counter = 1 ; counter <= 4 ; ++counter );
{

i dunno what to do after this part?????
for (
avg=total/6;


printf("the total for i is %f and the avg is %f",i,avg);
}

return 0;

}



please help me..
mohsh2002 is offline