File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -6,19 +6,22 @@ Input an octal number (using digit 0 - 7) :745
6
6
Expected Output :
7
7
The Octal Number : 745
8
8
The equivalent Decimal Number : 485
9
+
10
+ + 1. Figure out howo to convert octal to decimal
11
+ 745 = (7 * 8^2) + (4 * 8^1) + (5 * 8^0) = 485
12
+ 1.5 Input
13
+ 2. Pow function
14
+ 3. Function to count amount of digits
15
+ 4. Write function to iterate over digits and return sum of powers
16
+ 5. Invalid input
17
+ 6. Test
18
+ 7. Cpplint test
19
+ 8. Add and push
9
20
*/
10
21
11
22
#include <stdio.h>
12
-
13
- // Enum test
14
- enum State {WORKING = 0 , FAILED , FREEZED };
15
- enum State currState = 2 ;
16
-
17
- enum State FindState () {
18
- return currState ;
19
- }
20
23
21
24
int main () {
22
- ( FindState () == WORKING )? printf ( "WORKING" ): printf ( "NOT WORKING" );
25
+
23
26
return 0 ;
24
27
}
You can’t perform that action at this time.
0 commit comments