Commit 34990696 by phkarl

Upload New File

parent 30bc6d31
Showing with 28 additions and 0 deletions
#include <stdio.h>
int main(){
int decimal;
int binary[9];
int quotient;
int remainder;
int i = 9;
printf("Input decimal value:");
scanf("%d", &decimal);
quotient = decimal;
while(quotient != 0){
remainder = quotient % 2;
quotient = quotient / 2;
if(remainder == 1){
quotient = quotient - 0.5;
}
binary[i] = remainder;
i = i -1;
}
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment