[Solved] convert point form decimal to octal in c++?


 int deci, rem,  octal=0,  i=1;

 float de,  x,y,point,rem1;

  cout<<"enter the decimal"<<endl;
  cin>>deci;

Since deci is declared as int cin>>deci and entering ‘12.5’ will set deci to 12

BTW I assume the next line is a transcription typo deci=y doesnt make any sense at all. I assume you mean y = deci

Solution – declare deci as a float;

1

solved convert point form decimal to octal in c++?