Program Persamaan Kuadrat
program perskuadrat;
uses wincrt;
var
name : string;
Mau_coba_lagi : string;
a,b,c,D,x1,x2:real;
begin
repeat
clrscr;
writeln('Welcome to Program Persamaan Kuadrat');
write('Masukkan nilai a: '); readln(a);
if a=0 then
begin
writeln('Maaf nilai a tidak boleh sama dengan 0');
end
else
begin
write('Masukkan nilai b: '); readln(b);
write('Masukkan nilai c: '); readln(c);
D:=(b*b)-(4*a*c);
writeln('D = ',D:5:2);
if D<0 then
begin
writeln('D<0');
writeln('x1 dan x2 tidak real atau imajiner');
end
else if D=0 then
begin
writeln('D=0');
writeln('x1 dan x2 real dan sama');
x1:=(-b+(sqrt(D)))/(2*a);
x2:=(-b-(sqrt(D)))/(2*a);
writeln('x1= ',x1:5:2);
writeln('x2= ',x2:5:2);
end
else if D>0 then
begin
writeln('D>0');
writeln('x1 dan x2 real dan berlainan');
x1:=(-b+(sqrt(D)))/(2*a);
x2:=(-b-(sqrt(D)))/(2*a);
writeln('x1= ',x1:5:2);
writeln('x2= ',x2:5:2);
end;
end;
writeln('Mau coba lagi ? Y or N'); readln(Mau_coba_lagi);
until Mau_coba_lagi='N'
end.

More Related Content

PPTX
DOC
Palindrome number program c
PPTX
C Programming Example
PPTX
PDF
Switch
PDF
Bcsl 033 data and file structures lab s2-1
PDF
C Programming Example
Palindrome number program c
C Programming Example
Switch
Bcsl 033 data and file structures lab s2-1
C Programming Example

What's hot (18)

PDF
Odd number
PPTX
PDF
Bcsl 033 data and file structures lab s2-3
PDF
Bcsl 033 data and file structures lab s2-2
PDF
Bcsl 033 data and file structures lab s1-1
PDF
Bcsl 033 data and file structures lab s1-3
DOC
Shan
PDF
Progr3
DOCX
Write a program to perform translation
PDF
DOCX
Write a program to perform translation.
PPTX
PPTX
SIMPLE C PROGRAMS - SARASWATHI RAMALINGAM
DOCX
1 (1)
Odd number
Bcsl 033 data and file structures lab s2-3
Bcsl 033 data and file structures lab s2-2
Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-3
Shan
Progr3
Write a program to perform translation
Write a program to perform translation.
SIMPLE C PROGRAMS - SARASWATHI RAMALINGAM
1 (1)
Ad

Viewers also liked (11)

DOCX
RPP Sistem Persamaan Kuadrat
PPTX
Persamaan Linier Dua Variabel
PPTX
Sistem Persamaan linier dua variabel dan tiga variabel
DOC
Matematika-Persamaan dan pertidaksamaan
DOCX
Soal US Matematika SMA
PPTX
Bahan ajar Sistem Persamaan Linier Dua Variabel
PDF
Persamaan Kuadrat
PDF
Aplikasi fungsi linier dan sistem persamaan dalam bisnis
PPSX
Persamaan Kuadrat
PPTX
Sistem persamaan linear tiga variabel
PPTX
Sistem Persamaan Linear dan Kuadrat
RPP Sistem Persamaan Kuadrat
Persamaan Linier Dua Variabel
Sistem Persamaan linier dua variabel dan tiga variabel
Matematika-Persamaan dan pertidaksamaan
Soal US Matematika SMA
Bahan ajar Sistem Persamaan Linier Dua Variabel
Persamaan Kuadrat
Aplikasi fungsi linier dan sistem persamaan dalam bisnis
Persamaan Kuadrat
Sistem persamaan linear tiga variabel
Sistem Persamaan Linear dan Kuadrat
Ad

More from linda_rosalina (20)

PDF
Side Seeing
PPTX
Penggunaan Akun Edmodo
PPT
koordinat tabung dan bola
PPT
Geometri aksioma
DOCX
Sudut Pada Bidang Ruang Geometri
DOCX
analisis puisi matematika
PPT
Irisan bidang
DOCX
Statistik Dasar
PDF
Puisi matematika-unsri-zulkardi
PDF
Modul Logika dan algoritma
DOCX
Program seleksi data
DOCX
Program rata
DOCX
Program pengurutan data
DOCX
Program modus
DOCX
Program luas segitiga
DOCX
Program biodata
DOCX
Geometri
DOCX
Geomertri (Jarak pada Bidang )
DOCX
Modul weblog
PPTX
Bab viii uji normalitas dan homogenitas
Side Seeing
Penggunaan Akun Edmodo
koordinat tabung dan bola
Geometri aksioma
Sudut Pada Bidang Ruang Geometri
analisis puisi matematika
Irisan bidang
Statistik Dasar
Puisi matematika-unsri-zulkardi
Modul Logika dan algoritma
Program seleksi data
Program rata
Program pengurutan data
Program modus
Program luas segitiga
Program biodata
Geometri
Geomertri (Jarak pada Bidang )
Modul weblog
Bab viii uji normalitas dan homogenitas

Recently uploaded (20)

PPTX
Integrated Management of Neonatal and Childhood Illnesses (IMNCI) – Unit IV |...
PDF
Journal of Dental Science - UDMY (2021).pdf
PDF
Everyday Spelling and Grammar by Kathi Wyldeck
PDF
LIFE & LIVING TRILOGY - PART (3) REALITY & MYSTERY.pdf
PPTX
Module on health assessment of CHN. pptx
PPTX
Thinking Routines and Learning Engagements.pptx
PDF
Farming Based Livelihood Systems English Notes
PDF
The TKT Course. Modules 1, 2, 3.for self study
PDF
Journal of Dental Science - UDMY (2022).pdf
PDF
semiconductor packaging in vlsi design fab
PDF
fundamentals-of-heat-and-mass-transfer-6th-edition_incropera.pdf
PDF
Comprehensive Lecture on the Appendix.pdf
PDF
Race Reva University – Shaping Future Leaders in Artificial Intelligence
DOCX
Cambridge-Practice-Tests-for-IELTS-12.docx
PDF
CRP102_SAGALASSOS_Final_Projects_2025.pdf
PDF
Climate and Adaptation MCQs class 7 from chatgpt
PPTX
What’s under the hood: Parsing standardized learning content for AI
PDF
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
PDF
MA in English at Shiv Nadar University – Advanced Literature, Language & Rese...
PDF
English-bài kiểm tra tiếng anh cơ bản.pdf
Integrated Management of Neonatal and Childhood Illnesses (IMNCI) – Unit IV |...
Journal of Dental Science - UDMY (2021).pdf
Everyday Spelling and Grammar by Kathi Wyldeck
LIFE & LIVING TRILOGY - PART (3) REALITY & MYSTERY.pdf
Module on health assessment of CHN. pptx
Thinking Routines and Learning Engagements.pptx
Farming Based Livelihood Systems English Notes
The TKT Course. Modules 1, 2, 3.for self study
Journal of Dental Science - UDMY (2022).pdf
semiconductor packaging in vlsi design fab
fundamentals-of-heat-and-mass-transfer-6th-edition_incropera.pdf
Comprehensive Lecture on the Appendix.pdf
Race Reva University – Shaping Future Leaders in Artificial Intelligence
Cambridge-Practice-Tests-for-IELTS-12.docx
CRP102_SAGALASSOS_Final_Projects_2025.pdf
Climate and Adaptation MCQs class 7 from chatgpt
What’s under the hood: Parsing standardized learning content for AI
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
MA in English at Shiv Nadar University – Advanced Literature, Language & Rese...
English-bài kiểm tra tiếng anh cơ bản.pdf

Program persamaan kuadrat

  • 1. Program Persamaan Kuadrat program perskuadrat; uses wincrt; var name : string; Mau_coba_lagi : string; a,b,c,D,x1,x2:real; begin repeat clrscr; writeln('Welcome to Program Persamaan Kuadrat'); write('Masukkan nilai a: '); readln(a); if a=0 then begin writeln('Maaf nilai a tidak boleh sama dengan 0'); end else begin write('Masukkan nilai b: '); readln(b); write('Masukkan nilai c: '); readln(c); D:=(b*b)-(4*a*c); writeln('D = ',D:5:2); if D<0 then begin writeln('D<0'); writeln('x1 dan x2 tidak real atau imajiner'); end else if D=0 then begin writeln('D=0'); writeln('x1 dan x2 real dan sama'); x1:=(-b+(sqrt(D)))/(2*a);
  • 2. x2:=(-b-(sqrt(D)))/(2*a); writeln('x1= ',x1:5:2); writeln('x2= ',x2:5:2); end else if D>0 then begin writeln('D>0'); writeln('x1 dan x2 real dan berlainan'); x1:=(-b+(sqrt(D)))/(2*a); x2:=(-b-(sqrt(D)))/(2*a); writeln('x1= ',x1:5:2); writeln('x2= ',x2:5:2); end; end; writeln('Mau coba lagi ? Y or N'); readln(Mau_coba_lagi); until Mau_coba_lagi='N' end.