program to convert decimal number to octal.
//program to convert decimal number to octallllll
#include<stdio.h>
void main()
{
int dn, on, od=1, i=1,a=0;
printf("Enter Decimal number:\n");
scanf("%d", &dn);
while(od!=0)
{
od=dn%8;
dn=dn/8;
a=i*od+a;
i=i*10;
}
printf("your octal number is :\t%d", a);
}
Comments
Post a Comment