Program giving wrong answer (we have to find the largest and smallest no. in array)

@hiteshmehra809_c9f950ced91b5a1b hii hitesh i dont see any mistake and i also write same code and it works fine
#include

#include

using namespace std;

int main() {

int arr[]={10,202,3,78};

int n=4;

int maxi=INT_MIN;

int mini=INT_MAX;

for(int i=0;i<n;i++)

{

    if(arr[i]>maxi)

    {

        maxi=arr[i];

    }

    if(arr[i]<mini)

    {

        mini=arr[i];

    }

}

cout<<maxi<<" "<<mini;

return 0;

}

@hiteshmehra809_c9f950ced91b5a1b see this code and match with your

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.