I cant come to the conclusion of where i am lacking in the code i have written as i cannot pass my test case for this particular problem
Hello @nikunjdahiya100_5cd11198034eff48,
Errors:
- You don’t need to take input n as it is always a constant = 3,
- Problem is not asking to print "largest number is: ".
Correct Code:
int n = 3;
int i=1;
int largest = INT_MIN;
int no;
while(i<=n){
cin>>no;
if(largest<no){
largest=no;
}
i=i+1;
}
cout<<largest<<endl;
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.
