i want to store binary equivalent of decimal number in char array by applying below code, but the problem is i'm not able to hold the last bit of the decimal number. I am getting garbage values
What you want to see if you output your char arry? String of 0s and 1s or 4 characters (possibly invisible) with values corresponding to individual byte of integer?