0

Whats the error here?

Pls..i cant understand the error here https://code.sololearn.com/cboI8IsH09ai/?ref=app

24th Dec 2019, 2:18 PM
Y AD Ù
Y AD Ù - avatar
3 Réponses
+ 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.
24th Dec 2019, 2:23 PM
Avinesh
Avinesh - avatar
+ 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; }
24th Dec 2019, 2:34 PM
Samet Sevindik
Samet Sevindik - avatar
0
Thnks bruh
24th Dec 2019, 2:41 PM
Y AD Ù
Y AD Ù - avatar