ist possible to have another if statement after the first if statement..

this is just an example

private void button_click(object sender, eventargs e)
try
{
if(age>5||age<=10)
{massagebox.show("young");}
else if(age>10||age<20);
messagebox.show("example");
}

catch(exception)
messagebox.show("error");

//can i have another if statement here???
if(something ==eg)
{messagebox.show("thanks");
}

Recommended Answers

All 2 Replies

Not really understanding what you mean...You can have as many if statements as you want wherever you want pretty much.

Yes you can, except you have mis-matched {} in your example.

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.