The output of the below code is 660 44 352 660
. My question is how does the element()
function return the value of k
without a return
statement. Can someone explain the logic behind it
#include <stdio.h>
int k = 9;
int element(int a, int b) {
k = k + (a * b);
}
int main() {
int a = 12, b = 5, c = 7;
a = element(c, b);
b = element(a, c);
c = element(a, c);
printf("%d ", k);
printf("%d ", a);
printf("%d ", b);
printf("%d ", c);
}