#include iostreamusing namespace std;int main(){ int numero, dividendo, resto, divisor = 2; string binario = ""; cout "Ingrese el numero decimal a convertir a sistema binario" endl; cin numero; dividendo = numero; while(dividendo = divisor){ //Mientras el dividendo sea mayor o igual que el divisor, es decir, mayor o igual que 2. resto = dividendo % 2; if(resto == 1) binario = "1" + binario; //Si el resto es igual a 1 concatenamos 1 a la variable string llamada binario else binario = "0" + binario; // Sino concatemanos 0 //Es importante este orden de concatenación (primero el bit y luego el valor de la variable) esto para que nuestro número //en sistema binario esté ordenado correctamente. dividendo = dividendo/divisor; // Actualizamos el valor del dividendo dividiendolo entre 2. } if(dividendo == 1) binario = "1" + binario; // Por último sí el valor final del dividendo es 1 concatenamos 1 sino concatenamos 0. else binario = "0" + binario; cout "En sistema binario " numero " se escribe " binario endl; return 0;}
#include iostream#include sstream // Para convertir el resto de la division de int a string.using namespace std;int main(){ int numero, dividendo, resto, divisor = 2; string binario = "", ordenado = ""; stringstream stream; // De int a string cout "Ingrese el numero decimal a convertir a sistema binario" endl; cin numero; dividendo = numero; while(dividendo = divisor){ resto = dividendo % 2; stream resto; // Almacena el resto de las divisiones concatenandolas en el objeto stream. dividendo = dividendo/divisor; } stream dividendo; binario = stream.str(); //Almacenamos en la variable llamada binario de tipo string los valores concatenados del objeto stream. for(unsigned int i = 0; i binario.size(); i++)//Debemos ordenar los bits ordenado = binario[i] + ordenado; cout "En sistema binario " numero " se escribe " ordenado endl; return 0;}
import java.util.Scanner;public class DecimalABinario { public static void main(String[] ar){ Scanner teclado = new Scanner(System.in); int dividendo, resto, divisor = 2, numero; String binario = ""; System.out.println("Ingrese el numero decimal a convertir a sistema binario"); numero = teclado.nextInt(); dividendo = numero; while(dividendo = divisor){ //Mientras el dividendo sea mayor o igual que el divisor, es decir, mayor o igual que 2. resto = dividendo % 2; if(resto == 1) binario = "1" + binario; //Si el resto es igual a 1 concatenamos 1 a la variable string llamada binario else binario = "0" + binario; // Sino concatemanos 0 //Es importante este orden de concatenación (primero el bit y luego el valor de la variable) esto para que nuestro número //en sistema binario esté ordenado correctamente. dividendo = dividendo/divisor; // Actualizamos el valor del dividendo dividiendolo entre 2. } if(dividendo == 1) binario = "1" + binario; // Por último sí el valor final del dividendo es 1 concatenamos 1 sino concatenamos 0. else binario = "0" + binario; System.out.println("En sistema binario " + numero + " se escribe " + binario); }}
import java.util.Scanner;public class DecimalABinario2 { public static void main(String[] ar){ Scanner teclado = new Scanner(System.in); int dividendo, divisor = 2, numero, resto; String binario = ""; System.out.println("Ingrese el numero decimal a convertir a sistema binario"); numero = teclado.nextInt(); dividendo = numero; while(dividendo = divisor){ resto = dividendo % divisor; binario = resto + binario; dividendo = dividendo/divisor; } binario = dividendo + binario; System.out.println("En sistema binario " + numero + " se escribe " + binario); }}
WordPress theme designers AUTOMOBILE ACCIDENT ATTORNEY car insurance quotes mn workplace accident attorney Best criminal lawyer in Arizona Criminal lawyer structured settlement need cash now Online Colleges mesothelioma lawyer chicago mesothelioma cases Dedicated Hosting Dedicated Server Hosting FORENSICS ONLINE COURSE donate your car for kids Online casino Casino Donate Old Cars to Charity Motor replacements PhD in counseling education Asbestos Lawyers Custom Christmas cards structured settlement brokers earthlink business internet HOW TO DONATE A CAR IN CALIFORNIA Make money online Australia houston tx auto insurance Psychic for Free Life Insurance Co Lincoln Mobile casino Social media campaigns refinance with poor credit Best social media platforms for business saskatchewan auto insurance Mortgage Adviser Motor Replacements Online Christmas cards Personal Injury Law Firm CHEAP AUTO INSURANCE IN VA la personal injury lawyer asbestos lung cancer Dallas Mesothelioma Attorneys Criminal defense lawyer MOTOR REPLACEMENTS fortis health insurance temporary Dwi lawyer washington mesothelioma attorney Donate cars in ma Live casino Italian cooking school Seo companies injury attorney baton rouge Casino reviews los angeles motorcycle accident lawyer DALLAS MESOTHELIOMA ATTORNEYS Donating Used Cars to Charity motorcycle accident lawyer san francisco DUI lawyer home phone internet bundle Hire php developers domain registration yahoo Sell Annuity Payment auto accident attorney Torrance Dayton Freight Lines Hire php programmers WordPress hosting Donate your Car for Money asbestos mesothelioma lawsuit Car Insurance Quotes MN LOW CREDIT LINE CREDIT CARDS personal injury solicitor EMAIL BULK SERVICE Social media management buyer of structured settlement annuity CHEAP DOMAIN REGISTRATION HOSTING car accident lawyer san bernardino structured settlement purchasers See more at http//wwwginfostopnet/ Social media strategies Social media platforms Online classes Proud Italian cook Php programmers for hire fast cash for house mesothelioma attorney Service business software Donate Cars Illinois Mortgage adviser mesothelioma lawyer dallas Psd to html New social media platforms Bankruptcy lawyer CAR INSURANCE QUOTES MN CAR INSURANCE QUOTES COLORADO Hire php developer car accident lawyers uk homeowner loans Computer science classes online Royalty free images stock best criminal lawyer in arizona World Trade Center Footage Dayton freight lines Paperport Promotional Code Psd to WordPress life insurance co lincoln Php programmers Best social media platforms mesothelioma attorney assistance Register Free Domains how to donate a car in california tucson car accident attorney REGISTER FREE DOMAINS Dallas mesothelioma attorneys semi truck accident lawyers Donate Car to Charity California VIRTUAL DATA ROOMS Seo services Criminal lawyer Miami Email bulk service Donate your car for kids Business finance group Social media platforms for business Custom WordPress theme designer structured settlement company Cheap auto insurance in VA BETTER CONFERENCING CALLS asterisk call center software Automobile Accident Attorney mesothelioma lawyer virginia Learning adobe illustrator attorney lawyer mesothelioma Car Insurance Quotes Colorado structured annuity settlement Best Seo company Business management software Met Auto sell structured settlement calculator Nunavut Culture Seo company mesothelioma charities Photo Christmas cards WordPress themes for designers mesothelioma information business voice mail service truck accident attorney los angeles selling annuity Social media examiner Tech school Html email Christmas cards Forensics Online Course Auto Accident Attorney student loan consolidation program BEST CRIMINAL LAWYER IN ARIZONA register free domains business voip solutions Adobe illustrator classes Forex Trading Platform Car Donate Social media tools Mesothelioma Law Firm cheap domain registration hosting ROYALTY FREE IMAGES STOCK Best Criminal Lawyers in Arizona accident car florida lawyer Donate Car for Tax Credit Donate Cars in MA Car Insurance Quotes PA car insurance companies Asbestos Lung Cancer most profitable internet business orlando criminal attorney donating used cars to charity personal injury accident lawyer Donate Your Car Sacramento How to Donate A Car in California WORLD TRADE CENTER FOOTAGE Donate Your Car for Kids Holland Michigan College personal injury law firm mesothelioma settlement amounts boulder personal injury lawyers Structures Annuity Settlement houston motorcycle accident lawyer HOLLAND MICHIGAN COLLEGE Annuity Settlements DONATE CARS IN MA MORTGAGE ADVISER Donate old cars to charity peritoneal mesothelioma Hard drive Data Recovery Services Donate a Car in Maryland Car Insurance Companies Cheap Domain Registration Hosting state of california car insurance Donating a Car in Maryland Futuristic Architecture Criminal Defense Attorneys Florida Car Insurance Quotes Utah small business administration sba Online Motor Insurance Quotes structured settlement quote Insurance Companies ANNUITY SETTLEMENT accident attorneys orange county Online Classes Massage School Dallas Texas Cheap car insurance in Virginia Low Credit Line Credit Cards Online motor insurance quotes firm law mesothelioma pharmacist jobs in chicago Cheap Auto Insurance in VA tennessee mesothelioma lawyer illinois law lemon Home Phone Internet Bundle Nunavut culture Email Bulk Service PHD on Counseling Education Neuson MESOTHELIOMA LAW FIRM Royalty Free Images Stock Car Insurance in South Dakota miami personal injury lawyer mesothelioma settlements california motorcycle accident lawyer car insurance quotes Cheap Car Insurance for Ladies sell annuity payment Webex Costs Cheap Car Insurance in Virginia Online College Course Better Conference Calls accident attorney in los angeles Met auto DONATE YOUR CAR FOR KIDS Virtual Data Rooms motorcycle accident attorney sacramento criminal defense federal lawyer Car Accident Lawyers Data Recovery Raid business administration masters Health Records Personal Health Record insurance medical temporary Motor Insurance Quotes Personal Injury Lawyers Home phone internet bundle Car Insurance Quotes Injury Lawyers Insurance Online Criminal Justice Degree DONATING USED CARS TO CHARITY
mesothelioma survival rates Web Hosting and Domains Cooking Recipes Bluehost domain registration yahoo Conference Call Online Classes Loans Mortgage Online casino ANNUITY SETTLEMENT eCommerce sites Insurance Health Business Attomey DAYTON FREIGHT LINES donate old cars to charity Transfer Data Recovery Services Rehab Credit Software Recovery Lawyer small business administration sba SELLING A STRUCTURED SETTLEMENT ANNUITY Gas/Electricity structured settlements annuities Donate Cord Blood Hosting Donate car for tax credit Classes Claim Health Donate your car for kids Insurance Blogs Treatment · PaperPort Promotional Code Nunavut culture Trading Degree Coupons Student Loans Laws and lawyers Attormey STRUCTURE SETTLEMENTS Business CRIMINAL DEFENSE ATTORNEY PALM BEACH · World Trade Center Footage Donate Car for Tax Credit Mesothelioma Law Firm Donate Car to Charity California mesothelioma suit STRUCTURED ANNUITY SETTLEMENT domain name yahoo NUNAVUT CULTURE · Car Accident Lawyers · Mortgage Adviser AUTO ACCIDENT LAWYER DENVER structured settlement annuity companies Donate your car Sacramento
No hay comentarios:
Publicar un comentario