here i wrote the same code as same as the code instructed in the video but it didnt run properly and gave only the output as the max no as defined in the climits . it did not ask for the input of no. while compiling . i used the coding blocks compiler as well as code chef compiler.
Min and max of number
#include
#include
using namespace std;
int main() {
int n;
cin>>n;
int min_no = INT_MAX;
int max_no = INT_MIN;
int no;
for(int i=0; i<n; i++)
{
cin>> no;
if(no> max_no){
no=max_no;
}
if(no< min_no){
no=min_no;
}
cout<<"max no is "<<max_no<<endl;
cout<<"min no is "<<min_no<<endl;
}
return 0;
}
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.