I am working on a homework problem that asks us to write a function in C that will convert from decimal to octal. Here’s what I have so far
int oct(int num) {
if (num < 8) {
return num;
}
else {
}
}
So yeah I’m pretty stuck, any help is very much appreciated
Thanks
You can use %o to print a octal number
check this link
http://ideone.com/OLXEL7
Hope this helps