Can else have more than one statement?

if (control)
	      <statement>
	   
           else if (control)
	      <statement>
	   
           else
	   {
               <statement>
               <statement>
           }

Recommended Answers

All 2 Replies

Yes. (But it's really the if - fully brace everything and this becomes obvious.)

Yes.
Generally speaking, any place you can have a single statement, you can use multiple statements enclosed in curly braces { }

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.