Write an algorithm, draw a corresponding flowchart and write an
interactive program to convert a binary number to its octal equivalent.
interactive program to convert a binary number to its octal equivalent.
C program c program to convert binary to octal
#include<stdio.h>
int main(){
long int binaryNumber,octalNumber=0,j=1,remainder;
printf("Enter any number any binary number: ");
scanf("%ld",&binaryNumber);
while(binaryNumber!=0){
remainder=binaryNumber%10;
octalNumber=octalNumber+remainder*j;
j=j*2;
binaryNumber=binaryNumber/10;
}
printf("Equivalent octal value: %lo",octalNumber);
return 0;
}
I WANTED ALGORITHM ALSO :(
ReplyDeletedid u get any algorithm, flow chart...???
Deleteif you guys have the solved assignment of MCS-011 then send to me pleaaachhh... :P at jaynishad2010@gmail.com
ReplyDeleteAny of u have the flow chart for this question?????
ReplyDeleteThis comment has been removed by the author.
ReplyDeletethins program convert binary to decimel............... dislike.. we want binary to ocatal
ReplyDelete