That's a good question. Sometimes you don't need local storage for the value you're returning. In your case, scanf requires someplace to store the value read, so there's no getting around that.
But assume a and b are integers and foo() is a another function. We can return expressions directly using a, b, and foo().
Code:
return a + b ;
////////////////
return 2*a + 3*b ;
///////////////
return a < b; //This takes advantage that the expression a < b evaluates to 1 if true, 0 if false.
//////////////
return a + foo( a, b ); //Here we call foo with a and b as arguments, and we will return the sum of a and the value that foo returns
Hope that gives you some ideas.