Why is this program not printing all wanted values?
I have coded this program that gets a number and prints it in base 2. https://www.sololearn.com/compiler-playground/c202dhtnyFTV But I have two problems. 1.when I run the *.exe file on my PC, the program doesn't properly work for some numbers like 77, but when I input 77 in an online compiler like Sololearn, it has no problem and works properly. The only message that CMD turns out after not printing the number in base 2 is this : Process exited after 2.492 seconds with return value 3221225477 While the return value should be 0. 2. When I enter big numbers like 785, the output is half of the expected value, like : what program returns : 00010001 what it should returns : 1100010001 I tried to solve this problem by writing "long int" instead of "int", but the result became worse : 0001 Could you please help me to solve these two problems? Thanks in advance.