this is my leetcode 1st day 1st problem called two_sum am getting an error, please help me with the mistake what I have done, in vs code this, below code was getting no error and also no output, but in leetcode I getting an error :
Line 25: Char 5: error: conflicting types for ‘main’ [solution.c] int main(int argc, char *argv[]) { ^~~~ where my code is only 22 lines but I was getting error in the 25th line
#include <stdio.h>
void main()
{
int n, a[10], i, j, t;
printf("enter the array size");
scanf("%d", &n);
printf("enter th array values");
for (i = 0; i < n; i++)
scanf("%d", &a[I]);
printf("enter the targest sum");
scanf("%d", &t);
for (i = 0; i < n; n++)
{
for (j = i+1; j < n; n++)
{
if (a[i] + a[j] == t)
{
printf("[%d,%d]", i, j);
}
}
}
}
2nd try: I replaced with a new code in the last if statement to check in another way. so, now I got output but, not the correct one