A program that read any decimal number & display equivalent octal number in Cpp.

#include<stdio.h>
#include<conio.h>
#include<iostream.h>

void main()
{
    int n,a[10],i=0;
    clrscr();
    cout<<"Enter any decimal number : ";
    cin>>n;
    while(n/8!=0)
    {
        a[i++]=n%8;
        n=n/8;
    }
    a[i]=n;

    cout<<"Same octal number is :";
    for(;i>=0;i--)
      cout<<a[i];
    getch();
}



////////////////////////////////////////////
Copy & paste this code in your TC & run, then you will get output.......
If you have any problem please comment below.........