This document was uploaded by user and they confirmed that they have the permission to share
it. If you are author or own the copyright of this book, please report to us by using this DMCA
report form. Report DMCA
Overview
Download & View Coding Decimal 2 Binary as PDF for free.
int bilangan = int.parse(txtinput.text); int hasilbagi, sisabagi; string bilstr = ""; hasilbagi = 1; while (hasilbagi != 0) { hasilbagi = bilangan / 2; sisabagi = bilangan % 2; bilstr = sisabagi.tostring() + bilstr; bilangan = hasilbagi; lblhasil.text=bilstr; } //catatan: lblhasil = nama label untuk hasil binary yg akan dimunculkan, // txtinput = nama textbox untuk input angka desimal