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

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

void main()
{
  int n,a[10],i=0;
    clrscr();
    printf("Enter any decimal number : ");
    scanf("%d",&n);
    while(n/8!=0)
    {
        a[i++]=n%8;
        n=n/8;
    }
    a[i]=n;

    printf("Same octal number is :");
    for(;i>=0;i--)
      printf("%d",a[i]);
    getch();
}




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