#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int num,rev,sum=0;
cout<<"Enter a decimal number: ";
cin>>num;
do
{
sum=sum*10+num%8;
num=num/8;
}
while(num>0);
cout<<"\nThe octal equivalent of the number is: ";
do
{
rev=sum%10;
cout<<rev;
sum=sum/10;
}
while(sum>0);
gotoxy(25,24); cout<<"Press any key to continue......";
getch();
}