I have a question about c++ if

Asked 2 years ago, Updated 2 years ago, 24 views

What should I do if I want to do multiple conditions in the if statement?

If I meet only one of the conditions, I want to make it happen. For example, you can enter only one of the three. I thought I could use "or" but I couldn't work.

c++

2022-09-22 18:31

1 Answers

if((n == 1) || (n == 6) || (n == 7)) { ... } You can write it like this.


2022-09-22 18:31

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.