1 Attachment(s)
How to show input variables from loop etc
So, I'm doing this project asking for number of inputs from user, show the inputs, make a table and average it.
I was only able to go as far as averaging it. I don't know whether the previous ones need array's and need some expert advice on this.
Here's how it should look like:Attachment 12180
and here's my code:
Code:
#include<stdio.h>
void main()
{
int h, size, i;
float sum, average;
//double[] p= new double[size]; unsure if needs arrays
printf("enter number of students");
scanf("%d",&size);
for(i=0,i<size,i++){
printf("enter height"+(i+1));
scanf("%d",&h);
sum+=h
}
average=h/size;
printf("%d"","&average);
}