Is this the expected behavior

My apologies if this is kind of vague question as I am new to R. While experimenting with R I found one weird behavior. When I create a function like:

myfunction <- function(a,b){

and call it like:

myfunction(b = 10, a = 20)

it returns with result 20, but if I simply call it without function via assigning it directly to variables like:

a <- 20
b <- 10
print(a, b)

I get an error:

Error in print.default(a, b) : invalid 'digits' argument

Furthermore I have read that printing multiple variables in the same line can be accomplished via:

sprintf("%i %i",a, b)

So here is it a bug that it is appearing in function call with result as the first argument?