convert 111 into octal
Answers
Answered by
0
#include<stdio.h>
int main () {
int n;
printf("%d",&n);
int octal[40];
int i = 0;
while( n > 0) {
octal[i] = n % 8;
i++;
n /= 8;
}
for(int j = i - 1;j >= 0;j--) {
printf("%2d",octal[j])
}
return 0;
}
int main () {
int n;
printf("%d",&n);
int octal[40];
int i = 0;
while( n > 0) {
octal[i] = n % 8;
i++;
n /= 8;
}
for(int j = i - 1;j >= 0;j--) {
printf("%2d",octal[j])
}
return 0;
}
Similar questions