SlideShare uma empresa Scribd logo
1 de 2
Program konversi desimal ke biner,oktal dan heksadesimal pascal
Ni source codenya langsung copy aja ke pascal ok bos :
Uses wincrt;
Var
des , desi : integer;
jawaban : char;
procedure biner(des, desi : integer);
var bin : string;
begin
bin:='';
repeat
if(des mod 2 = 0) then bin:='0'+bin
else bin:='1' + bin;
des:=des div 2;
until des=0;
writeln;
writeln('(',desi,') desimal = ',bin,' (Biner)');
end;
procedure heksa(des, desi : integer);
var heks : string;
h : integer;
begin
Heks:='';
repeat
h:=des mod 16;
case h of
0: heks:= '0' + Heks;
1: heks:= '1' + Heks;
2: heks:= '2' + Heks;
3: heks:= '3' + Heks;
4: heks:= '4' + Heks;
5: heks:= '5' + Heks;
6: heks:= '6' + Heks;
7: heks:= '7' + Heks;
8: heks:= '8' + Heks;
9: heks:= '9' + Heks;
10: heks:= 'A' + Heks;
11: heks:= 'B' + Heks;
12: heks:= 'C' + Heks;
13: heks:= 'D' + Heks;
14: heks:= 'E' + Heks;
15: heks:= 'F' + Heks;
end;
des:=des div 16;
until des=0;
writeln('(',desi,') desimal = ',Heks,' (Heksadesimal)');
end;
procedure oktal(des, desi : integer);
var oktal : string;
o : integer;
begin
oktal:='';
repeat
o:=des mod 8;
case o of
0:oktal:='0'+oktal;
1:oktal:='1'+oktal;
2:oktal:='2'+oktal;
3:oktal:='3'+oktal;
4:oktal:='4'+oktal;
5:oktal:='5'+oktal;
6:oktal:='6'+oktal;
7:oktal:='7'+oktal;
end;
des:= des div 8;
until des=0;
writeln('(',desi,') desimal = ',oktal,' (Oktal)');
end;
begin
repeat
clrscr;
writeln('**************************************************************
writeln('* Program Konversi Desimal ke Heksadesimal, Biner dan Oktal *
writeln('* oleh: Habibie Ed Dien, Shohib, Nanda E.p. & Ahmad Rizal
*
writeln('**************************************************************
writeln;
Write('Masukkan Suatu Bilangan Desimal : ');Readln(des);
desi:=des;
biner(des,desi);
heksa(des,desi);
oktal(des,desi);
writeln;writeln;
write('Mau coba lagi [Y/T]? : ');readln(jawaban);
until upcase(jawaban)<>'Y';
end.

');
');
');
');

Mais conteúdo relacionado

Destaque

Manifesto OAB Mato Grosso do Sul
Manifesto OAB Mato Grosso do SulManifesto OAB Mato Grosso do Sul
Manifesto OAB Mato Grosso do SulOsnir da Silva
 
гайван любов григорівна
гайван любов григорівнагайван любов григорівна
гайван любов григорівнаvitaha555
 
Hey Vivas_Prospectus Deck
Hey Vivas_Prospectus DeckHey Vivas_Prospectus Deck
Hey Vivas_Prospectus DeckHey Vivas
 
Weather it Together - Lisa's Charrette Presentation
Weather it Together - Lisa's Charrette PresentationWeather it Together - Lisa's Charrette Presentation
Weather it Together - Lisa's Charrette PresentationLisa Craig
 
(P. 157 196) 5. la competencia docente
(P. 157 196) 5. la competencia docente(P. 157 196) 5. la competencia docente
(P. 157 196) 5. la competencia docenteMineducyt El Salvador
 
Las preguntas que
Las preguntas que Las preguntas que
Las preguntas que asturesinfo
 
Programa de la Semana Negra
Programa de la Semana NegraPrograma de la Semana Negra
Programa de la Semana Negraasturesinfo
 
Visitas a las sedes para el taller de evaluacion
Visitas a las sedes para el taller de evaluacionVisitas a las sedes para el taller de evaluacion
Visitas a las sedes para el taller de evaluacioncaangarita
 
5 octubre congreso avance del sueño posible y asistencia técnica haití
5 octubre congreso  avance del sueño posible y asistencia técnica haití5 octubre congreso  avance del sueño posible y asistencia técnica haití
5 octubre congreso avance del sueño posible y asistencia técnica haitíMineducyt El Salvador
 

Destaque (20)

Manifesto OAB Mato Grosso do Sul
Manifesto OAB Mato Grosso do SulManifesto OAB Mato Grosso do Sul
Manifesto OAB Mato Grosso do Sul
 
гайван любов григорівна
гайван любов григорівнагайван любов григорівна
гайван любов григорівна
 
Hey Vivas_Prospectus Deck
Hey Vivas_Prospectus DeckHey Vivas_Prospectus Deck
Hey Vivas_Prospectus Deck
 
Weather it Together - Lisa's Charrette Presentation
Weather it Together - Lisa's Charrette PresentationWeather it Together - Lisa's Charrette Presentation
Weather it Together - Lisa's Charrette Presentation
 
Didáctica nérice
Didáctica nériceDidáctica nérice
Didáctica nérice
 
(P. 157 196) 5. la competencia docente
(P. 157 196) 5. la competencia docente(P. 157 196) 5. la competencia docente
(P. 157 196) 5. la competencia docente
 
20150806_kidou
20150806_kidou20150806_kidou
20150806_kidou
 
VMET_Document
VMET_DocumentVMET_Document
VMET_Document
 
Grafos
GrafosGrafos
Grafos
 
Ast c-012 clandestinaje
Ast c-012 clandestinajeAst c-012 clandestinaje
Ast c-012 clandestinaje
 
Canais Assíncronos I
Canais Assíncronos ICanais Assíncronos I
Canais Assíncronos I
 
Las preguntas que
Las preguntas que Las preguntas que
Las preguntas que
 
04.-CNRM-Final
04.-CNRM-Final04.-CNRM-Final
04.-CNRM-Final
 
test
testtest
test
 
1 b historia
1 b historia1 b historia
1 b historia
 
Higiene industrial
Higiene industrialHigiene industrial
Higiene industrial
 
Programa de la Semana Negra
Programa de la Semana NegraPrograma de la Semana Negra
Programa de la Semana Negra
 
Visitas a las sedes para el taller de evaluacion
Visitas a las sedes para el taller de evaluacionVisitas a las sedes para el taller de evaluacion
Visitas a las sedes para el taller de evaluacion
 
5 octubre congreso avance del sueño posible y asistencia técnica haití
5 octubre congreso  avance del sueño posible y asistencia técnica haití5 octubre congreso  avance del sueño posible y asistencia técnica haití
5 octubre congreso avance del sueño posible y asistencia técnica haití
 
HNC Certificate
HNC CertificateHNC Certificate
HNC Certificate
 

Último

4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 

Último (20)

Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 

Konversi

  • 1. Program konversi desimal ke biner,oktal dan heksadesimal pascal Ni source codenya langsung copy aja ke pascal ok bos : Uses wincrt; Var des , desi : integer; jawaban : char; procedure biner(des, desi : integer); var bin : string; begin bin:=''; repeat if(des mod 2 = 0) then bin:='0'+bin else bin:='1' + bin; des:=des div 2; until des=0; writeln; writeln('(',desi,') desimal = ',bin,' (Biner)'); end; procedure heksa(des, desi : integer); var heks : string; h : integer; begin Heks:=''; repeat h:=des mod 16; case h of 0: heks:= '0' + Heks; 1: heks:= '1' + Heks; 2: heks:= '2' + Heks; 3: heks:= '3' + Heks; 4: heks:= '4' + Heks; 5: heks:= '5' + Heks; 6: heks:= '6' + Heks; 7: heks:= '7' + Heks; 8: heks:= '8' + Heks; 9: heks:= '9' + Heks; 10: heks:= 'A' + Heks; 11: heks:= 'B' + Heks; 12: heks:= 'C' + Heks; 13: heks:= 'D' + Heks; 14: heks:= 'E' + Heks; 15: heks:= 'F' + Heks; end; des:=des div 16; until des=0; writeln('(',desi,') desimal = ',Heks,' (Heksadesimal)'); end; procedure oktal(des, desi : integer); var oktal : string; o : integer; begin oktal:=''; repeat o:=des mod 8; case o of 0:oktal:='0'+oktal; 1:oktal:='1'+oktal; 2:oktal:='2'+oktal; 3:oktal:='3'+oktal;
  • 2. 4:oktal:='4'+oktal; 5:oktal:='5'+oktal; 6:oktal:='6'+oktal; 7:oktal:='7'+oktal; end; des:= des div 8; until des=0; writeln('(',desi,') desimal = ',oktal,' (Oktal)'); end; begin repeat clrscr; writeln('************************************************************** writeln('* Program Konversi Desimal ke Heksadesimal, Biner dan Oktal * writeln('* oleh: Habibie Ed Dien, Shohib, Nanda E.p. & Ahmad Rizal * writeln('************************************************************** writeln; Write('Masukkan Suatu Bilangan Desimal : ');Readln(des); desi:=des; biner(des,desi); heksa(des,desi); oktal(des,desi); writeln;writeln; write('Mau coba lagi [Y/T]? : ');readln(jawaban); until upcase(jawaban)<>'Y'; end. '); '); '); ');