+ 1
Conditional Statement
Can a âifâ statement be use without an âelseâ statement?
5 RĂ©ponses
+ 7
Yes in any language it is possible.
+ 3
It depends on the language. For whichever language you are interested in, the easiest way to get an answer is to just try it. If the compiler or interpreter doesn't complain, it works.
+ 2
Yes, if block statement use without else statement, and why use if-block statement mostly? because if the if-block condition false then it goes to else block statement, otherwise no problem if we use if-block statement without the else statement.
+ 1
Yes, the if statement can be used without âelseâ because if only executes the indented block of code as long as the condition evaluates fo True, while else only execute if the âifâ statement does not evaluate to âTrueâ.
- 1
Yes, if only the condition is âTrueâ.