Skip to content

Commit 4cc7878

Browse files
committed
wrote a plan to solve the exercise
1 parent 42fb2b2 commit 4cc7878

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

For loop/51. Octal to decimal.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,22 @@ Input an octal number (using digit 0 - 7) :745
66
Expected Output :
77
The Octal Number : 745
88
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
920
*/
1021

1122
#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-
}
2023

2124
int main() {
22-
(FindState() == WORKING)? printf("WORKING"): printf("NOT WORKING");
25+
2326
return 0;
2427
}

0 commit comments

Comments
 (0)