0

I'm trying to make a program that converts octal numbers to decimal numbers. I know the concept is taking the %10 of the number to get the first digit, /10 the number then take the %10 to get the second digit and multiplying by increase powers of 8, but I have no idea how to translate this to a program. Could someone please guide me in the right direction.

```
#include <stdio.h>
int main ()
{
int num1, base8, x, y, n, lastDigit;
printf("Enter an integer in base 8: ");
scanf("%d", &num1);
num1 %10 =lastDigit;
n = 1;
x=num1
if(num1 > 10){
x/10 = x;
x %10 =y;
while (x != y) {
x/10 = x;
x %10 =y;
base8 = y*8^n
n = n + 1;
}}
sum= base8+lastDigit;
printf("%d", sum);
return 0;
}
```