i am having problem in executing the following program.........when i execute it,it's getting hanged....pls gimme a gud solution
#include<stdio.h>
main()
{
int n,x=0,y=1,z;
printf("\nEnter a number of your choice:");
scanf("%d",&n);
z=n;
do
{
x=n%8;
x=x+x*y;
y=y*10;
z=z/8;
}while(z<8);
printf("\nThe octal equivalent of the number entered is %d",x);
}