#include <stdio.h>
#include <stdlib.h>
int main()
{
int n,i=1, k;
int j;
int biner[10];
printf("Masukkan bilangan\t:");
scanf("%d",&n);
while(n>0){
biner[i]=n%2;
n=n/2;
i=i+1;
k=i;
}
for(j=k-1;j>0;j--)
{
printf("%d",biner[j]);
}
}
#include <stdlib.h>
int main()
{
int n,i=1, k;
int j;
int biner[10];
printf("Masukkan bilangan\t:");
scanf("%d",&n);
while(n>0){
biner[i]=n%2;
n=n/2;
i=i+1;
k=i;
}
for(j=k-1;j>0;j--)
{
printf("%d",biner[j]);
}
}
c++nya gmna gan?
ReplyDelete