yes u can do that also. absolutely correct that way also
To find the max min for n no
I won’t be able to do please write the program and give me in that way I had tried many Times please write it and give me while using n>0;
and at last n=n-1 please write and give me that program
#include
using namespace std;
int main() {
int n;
cin>>n;
int min=INT_MAX;
int max=INT_MIN;
int no;
while(n < 0){
cin>>no;
if(no<min){
min=no;
}
if(no>max){
max=no;
}
n = n-1;
}
cout<<“max”<<max<<endl;
cout<<“min”<<min<<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.