0

decimal to octal converter

someone could help me using C program,

18th Jul 2018, 7:05 AM
Robin J. Sestoso
Robin J. Sestoso - avatar
3 Réponses
0
If you only need to print a number in octal base you can use printf function. http://www.cplusplus.com/reference/cstdio/printf/ #include <stdio.h> int main() { int i; printf("Enter an integer: "); scanf("%d", &i); printf("%d\nDecimal -> %d | Octal -> %o", i, i, i); return 0; } Code updated Robin J. Sestoso Hth, cmiiw
18th Jul 2018, 7:18 AM
Ipang
+ 1
thanks but we need to include scanf(" %d", & varisble)
18th Jul 2018, 7:28 AM
Robin J. Sestoso
Robin J. Sestoso - avatar
+ 1
thank you..
18th Jul 2018, 7:50 AM
Robin J. Sestoso
Robin J. Sestoso - avatar