Skip to content

Commit 06ae248

Browse files
committed
Started the next one
1 parent 544d92f commit 06ae248

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

For loop/51. Octal to decimal.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright 2022 finchren
2+
/*
3+
Write a program in C to convert an octal number to a decimal without using an array
4+
Test Data :
5+
Input an octal number (using digit 0 - 7) :745
6+
Expected Output :
7+
The Octal Number : 745
8+
The equivalent Decimal Number : 485
9+
*/
10+
11+
#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+
21+
int main() {
22+
(FindState() == WORKING)? printf("WORKING"): printf("NOT WORKING");
23+
return 0;
24+
}

0 commit comments

Comments
 (0)