Functions do not require assignment. The value is simply thrown away if it is not required.
int OutputSquareValue(int value) {
int result = value * value;
printf("%d", result);
return result;
}
If you don’t need the result in your code, but you want it to be output, you go
OutputSquareValue(5);
And all is well. If you need to use the new value, you go
printf("Squre of %d = ", x);
y = OutputSquareValue(x);
printf("%d^4 =", x);
OutputSquareValue(y);
source
share