#include #include //global variables: every function can use them int r0, r1 ,r2; void octalValue(int n) { //local variables: only the octalValue function use them int q0, q1, q2; q0 = n/8; r0 = n%8; q1 = q0/8; r1 = q0%8; q2 = q1/8; r2 = q1%8; } int main() { int n; printf("enter a number: "); scanf("%d", &n); octalValue(n); //print in binary printf("%d in octal is: %d%d%d\n", n, r2, r1, r0); printf("The program gives %o for %d\n", n, n); system("pause"); }