Some consider it bad practice, I'm personally ok with it as it can be cleaner-looking code. You can also do it in this way:
foo() {
int results = 0; // good practice to initialize
if (a < b) {
results = 0; // redundant, likely optimized out
} else {
// lots of calculations in this block
results = 1;
}
return results;
}