Converting decimal to octal
Just, i don't understand why?

What's wrong with (for integer):

#include &lt;iostream&gt;
int main() {
    int input;
    std::cout &lt;&lt; "Enter decimal number: ";
    std::cin &gt;&gt; std::dec &gt;&gt; input;
    std::cout &lt;&lt; '\n' &lt;&lt; std::oct &lt;&lt; input &lt;&lt; '\n';
}


And about your code:


Avoid using namespace std, it's a bad practice
Just main() isn't a valid prototype for the entry point, at least use `int main()
Define variables in the closest scope possible.
Try naming variable consistently
de=de/8; can be simplified to de /= 8;
floating point conversion is a bit more tricky than just doing what you do


Edit: After testing it (and correcting main() and) : Your code just doesn't work, even for an integer value

Enter decimal no :: (0)10 = (32767.)8
Enter decimal no :: (8)10 = (32776.)8
Enter decimal no :: (10)10 = (32779.)8


Test yourself