Difference between 1 to 10

How do I make an IF election ?

I mean that if i get the num ==>1 then x will happen
and if I'm geting the number ==>10 then y will happen ...

1
2
3
4
5
6
7
8
if(n >= 1 && n < 10)
{
    // do x
}
else if(n >= 10)
{
    // do y
}
and if it is a string?
and I have all the numbers
1
2
3
4
5
6
7
8
9
10
???
Last edited on
1
2
3
4
5
6
if (line_sim[0]=='1')
				{
					if (line_sim.size()==1)
						cout<< Head->get_liters_mounth (Head) << endl;// choice (1) 
					else cout<<"NUMBER 10"<<endl;
				} 
Topic archived. No new replies allowed.