suppose i have defined a int x
with a value of 10, along with a function int printnumber
with required parameters int num
.
int printnumber(int num) {/*it will print the number*/ }
I called the function printnumber
, passing the variable x as an argument. expected that it will print the value of 10
printnumber(x);
however, it also works if I just passed a raw 10 number as a parameter
printnumber(10);
why is this?