doubt in program not getting the mistake

#include<stdio.h>
int linearsearch(int a[5],int r,int e)
{
int i;
for(i=0;i<r;i++)
{
if(e==a[i])
return 1;
}
}
int main()
{
int r;
printf(“enter the size of array\n”);
scanf("%d",&r);
int a[5];
for(i=0;i<r;i++)
scanf("%d",&a[i]);
printf(“enter the value to be searched”);
int e;
scanf("%d",&e);
int flag=linearsearch(a,r,e);
if (flag==1)
printf(“element found”);
else
printf(“element not found”);
}

NOT GETTING MISTAKE…WATS THE MISTAKE

Did you try returning a number that is not 1, from linearsearch, after the for loop?

Something like

int linearsearch(int a[5],int r,int e)
{
    int i;
    for(i=0;i<r;i++)
    {
        if(e==a[i])
        return 1;
    }
    return 0; // right here
}

in linearsearch()
,u didn’t returned value if e!=a[i].
in main()
,this will only work for <=5 elements and give error if r>5.
I have just checked ur syntax error.
I would suggest u need to study C properly and use codeblocks for writing codes which shows error lines.