# Program to convert binary to octal using while loop print("Enter a binary number: ")binary=int(input());octal = 0decimal = 0i = 0while (binary != 0):      decimal = decimal + (binary % 10) * pow (2, i)      i+=1      binary = binary // 10i = 1while (decimal != 0):      octal = octal + (decimal % 8) * i      decimal = decimal // 8      i = i * 10print("octal value: ",octal)