Skip to content

Commit 58b6211

Browse files
committed
doing octal
1 parent ab1d7e4 commit 58b6211

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

For loop/50. Decimal to octal.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Enter a number to convert : 79
66
Expected Output :
77
The Octal of 79 is 117.
88
9-
1. Take input
9+
+ 1. Take input
1010
2. Figure out how to convert to octal
1111
3. Invalid input
1212
4. Convert
@@ -16,6 +16,17 @@ The Octal of 79 is 117.
1616
8. Add and push
1717
*/
1818

19+
#include <stdio.h>
20+
21+
int input_decimal_number();
22+
1923
int main() {
24+
int decimal_number = input_decimal_number();
2025
return 0;
2126
}
27+
28+
int input_decimal_number() {
29+
int decimal_number;
30+
scanf("%d", &decimal_number);
31+
return decimal_number;
32+
}

0 commit comments

Comments
 (0)