0
decimal to octal converter
someone could help me using C program,
3 Answers
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
+ 1
thanks but we need to include scanf(" %d", & varisble)
+ 1
thank you..