Find the maximum of three numbers containing both positive and negative

My two test cases are getting failed for this code and I’m not able to see that testcases also .When i run this code in my compiler it is giving correct output for both positive and negative.
#include
using namespace std;
#include
int main() {
int n,no,i=1;
cin>>n;
int max=INT_MIN;
while(i<=n){
cin>>no;
if(max<n){
max=n;
}
i=i+1;
cout<<max<<endl;

Hey @dips123deepali_c25f140838182212 can you please provide me the question link.

hey @dips123deepali_c25f140838182212 you have to just find the largest of 3 numbers just run the if else loop 3 time with the proper conditions you will get the answer like
1.) if(a>=b and b>=c){
return a;
else if(b>=a and a>=c){
return b;
else return
c

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.