If statements

mixhi4ever (14)
Can you include an if statement inside an else if statement?

THANKS
L B (3805)
1
2
3
4
5
6
7
8
9
10
11
if(something)
{
    go();
}
else if(someone)
{
    if(anyone)
    {
        sayYesYouCan();
    }
}
mixhi4ever (14)
LB are you positive? It will count for my grade thanks
James2250 (323)
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
	}
}
mixhi4ever (14)
Alright, thanks everyone for your help, I appreciate it!
Registered users can post here. Sign in or register to post.