/*
================================================================================
Program Mengkonversi Bilangan Desimal Ke Biner
================================================================================
Program Mengkonversi Bilangan Desimal Ke Biner
Created By Ahmad Ridha
Teknik Informatika
STMIK Banjarbaru
================================================================================
*/
#include
#include
main()
{
int bil, max, i,cetak;
char y;
do
{
gotoxy(20,1);printf("Program Konversi Bilangan Desimal Ke Biner");
gotoxy(20,2);printf("Created By Ahmad Ridha - 3101 0702 0636");
gotoxy(20,3);printf("Teknik Informatika");
gotoxy(20,4);printf("STMIK Banjarbaru\n");
printf("================================================================================");
gotoxy(16,8);printf("Silahkan Masukkan Bilangan Antara [0-255] : ");
scanf("%i",& bil);
clrscr();
if(bil<0 || bil>255)
{
gotoxy(16,6);printf("Maaf Bilangan Yang Anda Masukkan Salah!!!");
}
else
{
gotoxy(20,3);printf("Bilangan Yang Anda Masukkan : %i",bil);
gotoxy(23,4);printf("Dikonversi Ke Biner Menjadi");
gotoxy(26,6);
max = 128;
for(i=1;i<=8;i++)
{
if(bil >= max)
{
bil=bil-max;
cetak =1;
}
else
{
cetak =0;
}
printf("% i",cetak);
max=max/2;
}
}
gotoxy(22,8);printf("Apakah Anda Mau Coba Lagi???");
gotoxy(23,10);printf("Tekan [Y] Untuk Mengulang");
gotoxy(23,11);printf("Tekan [T] Untuk Selesai");
gotoxy(30,13);printf("Tekan : ");
scanf("%s",&y);
clrscr();
}
while(y=='Y' || y=='y');
clrscr();
gotoxy(20,8);printf("Terima Kasih Telah Mencoba Program Ini");
}
Tidak ada komentar:
Posting Komentar