➽ Program:-
#include<stdio.h>
int main()
{
int decimal_number,
octal_number = 0, i = 1;
printf("Enter
the Decimal Number: ");
scanf("%d", &decimal_number);
while(decimal_number
!= 0)
{
octal_number += (decimal_number % 8) * i;
decimal_number /= 8;
i *= 10;
}
printf("Octal
value is %d", octal_number);
return 0;
}
➽ Output:-
Enter the Decimal Number: 92
Octal value is 134
0 Comments
Please do not enter any spam link in the comment section.