I m trying to find the biggest number in the array but problem is that it keeps returning one
#include <stdio.h>
int FindBiggest(int *arr,int choice)
{
int i;
int num=0;
for(i=0;arr[i]<=sizeof arr;i++) {
if(num<arr[i])
num=arr[i];
}
return num;
}
int main(void)
{
int arr[]={0,5,3};
int result;
result=FIND_NUM(arr,BIGGEST);
printf("%d\n",result);
getchar();
return 0;
}
even though in my function i set the number to 0 first then after that we check with the if num<array whish ofcourse it is now it we set the num to array untill there no we found our biggest num i dunno its problem :s