As far as using the else/else-if statements there is absolutely nothing wrong with what you have done. I'm assuming you have run it through a compiler and it runs okay.
You can use a switch statement but it offers nothing better than an if/else if statement, it is just personal preference. I like ifs better but it doesn't harm you to known the switch method if you want to look into it.
The other option you could go for is to have functions that you invoke outside of your main function, but this is more useful when you have code that repeats itself, so unless you were to call the same question twice within one run of the program.
For a beginner to c++ I think you are doing this in a fine way. I'm assuming afterwards you will check the users answer to the value of c, but I will give you the benefit of the doubt as this isn't finished yet :P
As for the problem with the two numbers, I'm assuming this means you want 'a' to be the higher number than 'b' at all times.
After you get a value for both a and b you can call this if statement
1 2 3 4 5
|
if (b > a){
double temp = b;
b = a;
a = temp;
}
|
This will ensure that a is always the bigger of the two numbers, you don't have to worry about generating numbers until b is a smaller value
I hope this is what you wanted, if not post back =]