I'm new to programming. And I'm a bit confused about what is considered returning a value in programming.
From what I seen printf
is considered as a function that takes in arguments but doesn't return value.
For example if I use code like this
int a=10;
printf ("a-b is,%i,%i",a-b,a++);
printf
performs a calculation and return a value of a-b
that wasn't there before in my computer or code but now exists, is that value returning even if I can't set variable equal to it? Is something value returning only if you can set variable equal to it if so why? Or is it value returning if it gives back something or rather returns something in main and main part of code after its done executing?
But even so it returns a++
back in main within function body so it creates and gives back new value to main within its own code. Isn't that also value returning it returned new value back to main part of code?
I have really weak understanding of what is value returning exactly, so it would be really helpful if someone could clarify. It seems to be one of those main concepts in programming?