Compile Error
foo.c: In function 'main': foo.c:4:19: error: 'n' undeclared (first use in this function) 4 | for(int i=1;i<n;i++) | ^ foo.c:4:19: note: each undeclared identifier is reported only once for each function it appears in foo.c:5:5: error: 'sum' undeclared (first use in this function) 5 | sum=arr[i]; | ^~~ foo.c:5:9: error: 'arr' undeclared (first use in this function) 5 | sum=arr[i]; | ^~~ foo.c:8:28: error: expected ';' before 'for' 8 | if(arr[i] > max)max=arr | ^ | ; 9 | for(int i =n-1;i>=;i++) | ~~~
Code
#include <stdio.h>
int main(){
int i;
for(int i=1;i<n;i++)
sum=arr[i];
int max =arr[0];
for(int i=1;i<n;i++)
if(arr[i] > max)max=arr
for(int i =n-1;i>=;i++)
printf("%d",arr[i]);
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1227 LUCC Party Check-in
- Contest
- LUCC Presents Kick & Code Intra LU Programming Contest
- Language
- C11 (GCC 13.2.0)
- Submit At
- 2025-09-01 06:36:12
- Judged At
- 2025-09-01 06:36:12
- Judged By
- Score
- 0
- Total Time
- 0ms
- Peak Memory
- 0 Bytes