Twitter Update

The program convert decimal numbers to binary [C]


eventually become also its program, this program change decimals into binary numbers consisting of 1 and 0.
for my friends who want to learn how to do altering decimal to binary can simply copy and paste the coding below. you can edit yourself.

#include<stdio.h>
#include<conio.h>
#include<windows.h>
void main()
{    ulang:
    int i=0,k,biner[100];
    int desimal;
    char pil;
    printf("        ==Program untuk mencari Bilangan biner==");
    printf("\n\nMasukan Bilangan desimal yang ingin dikonversikan ke biner : ");
    scanf("%i",&desimal);
    for(i=0;i<100;i++)
    {
    biner[i]=desimal%2;
    desimal=desimal/2;
    if(desimal==0)
    {
        break;
    }
    }
    k=i;
    printf("\n\n\n");
    for(i=k;i>=0;i--)
    {   
        printf("%i",biner[i]);
    }

    printf("\n\nMau Coba lagi y/n : ");
    scanf("%s",&pil);
    if(pil=='y')
    {
        system("cls");
        goto ulang;
    }
    else
    {
        getch();
    }
   
   
}

Hopefully can help ^_^

0 comments:

Post a Comment

ABOUT ME

IP
Albert Julius. Powered by Blogger.
Copyright © Albert'Blog