Have an array it contain number random Ex: arr[6] ={43,66,54,2,65,75};
There sum in 304, so suddenly one element will become zero how to find
which element has become zero and we have to find the address also.
That range of values happen to fit into char,
so if you are allowed to constrain arr to be that type, then
char zeebuf[1];
zeropos = snprintf(zeebuf,0,"%.*s", sizeof arr, arr );
and zeropos indicates the relative offset of the 0, with
zeropos = sizeof arr meaning that no 0 was found within the array.
[This might require UNIX98 compliance extensions]
If it is *certain* that some entry of arr has been 0'd then
instead of snprintf(), you can use zeropos = strlen() + 1
You cannot do this if arr might not have changed, because strlen()
would run off the end of arr, which would be Undefined Behaviour.
To recover the missing value, take the known sum and
subtract from it the sum of the array entries (make sure you
do the arithmetic in something a bit wider than char though!).