Compile Error
foo.c: In function 'main': foo.c:10:7: error: 'i' undeclared (first use in this function) 10 | for ( i =1;i<=N;i+=2) { | ^ foo.c:10:7: note: each undeclared identifier is reported only once for each function it appears in foo.c:14:1: error: expected declaration or statement at end of input 14 | } | ^
Code
#include<stdio.h>
int main () {
int T ;
scanf("%d",&T);
while (T--) {
int N, odd_count=0 ;
scanf("%d",&N);
for ( i =1;i<=N;i+=2) {
odd_count++ ;
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1041 Odd number
- Contest
- TLE_Headquarters - round #1
- Language
- C99 (GCC 13.2.0)
- Submit At
- 2024-03-27 17:28:34
- Judged At
- 2024-11-11 03:37:35
- Judged By
- Score
- 0
- Total Time
- 0ms
- Peak Memory
- 0 Bytes