If statements

closed account (4wRjE3v7)
Can you include an if statement inside an else if statement?

THANKS
1
2
3
4
5
6
7
8
9
10
11
if(something)
{
    go();
}
else if(someone)
{
    if(anyone)
    {
        sayYesYouCan();
    }
}
closed account (4wRjE3v7)
LB are you positive? It will count for my grade thanks
LB is right don't worry (just in case you needed a second opinion). You could always run something like this and see it for yourself.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
int x;
cin >> x;

if(x < 5)
{
}

else if(x >= 5)
{
	//Do something 

	if(x > 10)
	{
		//Do something else
	}
}
closed account (4wRjE3v7)
Alright, thanks everyone for your help, I appreciate it!
Topic archived. No new replies allowed.