0
Whats the error here?
Pls..i cant understand the error here https://code.sololearn.com/cboI8IsH09ai/?ref=app
3 odpowiedzi
+ 4
It's a semicolon ";" and not a comma "," inside the for loop.
You are also missing a ";" at the end of the printf().
Edit: Also it should be i<5 inside the for loop so that you can take 5 integer values from index 0 to 4 and print it.
+ 1
#include <stdio.h>
//progrm for inputting marks and getting the avg of it
int main() {
int mark[5];
int sum=0;
float avg=0.0;
int i=0;
for(i=0;i<4;i=i+1) // not ',' use ';'
{
scanf("%d",&mark[i]);
}
for(i=0;i<4;i=i+1) // not ',' use ';'
{
sum=sum+mark[i];
}
avg=sum/5;
printf("%f",avg); // you forgoted ';'
return 0;
}
0
Thnks bruh