void setprice(int p){
if(p>1000){
price=p;
}
else{
price=1000;
}
price=p;
}
i write this code…but it is showing the price which i have written in - c.setprice(-500);
no constraints are applying!
void setprice(int p){
if(p>1000){
price=p;
}
else{
price=1000;
}
price=p;
}
i write this code…but it is showing the price which i have written in - c.setprice(-500);
no constraints are applying!
@RASHMI2000 Hey Rashmi, the doubt you have raised is not clear enough. Please save the code on coding blocks ide and share its link. Also please explain what you are trying to do in the code or the problem statement and what exact problem are you facing.
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.