It would help if you'd format your code so we can follow it's flow. Proper indentation is crucial to understanding.
WaltP
Posting Sage w/ dash of thyme
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
>I'm trying to make a program that converts octal numbers to decimal numbers.
I don't suppose this would work for you:
#include <stdio.h>
int main ( void )
{
int number;
scanf ( "%o", &number );
printf ( "%d\n", number );
return 0;
}
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
>i believe i am suppose to come up with a formula
I figured, but it was worth a shot. My advice is to figure out the exact steps you use to do this conversion on paper. It's hard to tell the computer how to do something if you can't lay out the steps one by one.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401