} for(i=0;binr!=0;i++) { rem = binr%10; bin= bin*10 +rem ; binr=binr/10; } printf("the binary equivalent is: %ld",bin); getch(); return 0; }This is a code with0ut using a array and can be used for decimal to octal num also anly the change is to make 8, where 2 is written.