In your code, in the return
statement
return (kk,ll);
you're using the comma operator. By the property of the comma operator, you're not returning two values, rather you're returning the second operand of the comma operator only.
To elaborate, let's check the property of the comma operator, directly quoting the standard, C11
, chapter §6.5.17, (emphasis mine)
The left operand of a comma operator is evaluated as a void expression; there is a sequence point between its evaluation and that of the right operand. Then the right operand is evaluated; the result has its type and value.
So, essentially, a return statement like
return (kk,ll);
is same as
return ll;
Hope you can figure out the other case.
That said, the recommended signature for main()
is int main(int argc, char*argv[])
or , at least, int main(void)
.