Some like the ternary operator, some do not.
You teacher is good for showing you it, and letting you apply it. Like anything, it can be abused.
However, there is one really cool use of it that cannot be done any other way (AFAIK). Consider the following:
#define MAX(_a_, _b_) (((_a_) > (_b_)) ? (_a_) : (_b_))
Notice you can use this like this:
int x = MAX(5, 17);
I don't know of any way you could do this with an if...else statement. (You could do it with a function call, but that isn't the point.)
Personally, I avoid ternary in all but the simplest of cases.
And for the record, 1 line code in C does not necessarily execute any faster than 4 line code. Be wary of using ternary just so you can write 1 liners.
https://softwareengineering.stackexchange.com/questions/28314/is-the-ternary-operator-evil
Ternary operator: bad or good practice?