Commit ea0b804a by chazog

Upload New File

parent 41155144
Showing with 27 additions and 0 deletions
#include <stdio.h>
int main () {
int input;
int binaryNum[1000];
int i=0;
int j=0;
printf("Please input the number you would like to convert to binary:");
scanf("%d", &input);
while (input > 0) {
binaryNum[i] = input % 2;
input=input/2;
i++;
}
for ( j=i-1; j>=0; j=j-1){
printf("%d", binaryNum[j]);
}
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