Tugas 14
Algoritma
if d > 0 then
d <- d - 1
else
d <- 59
if (m > 0) then
m <- m - 1
else
m <- 59
j <- j - 1
endif
endif
output( j + m - d )
Pascal
uses crt;
var
j,m,d : integer;
begin
clrscr;
write('masukan nilai j: '); readln(j);
write('masukan nilai m: '); readln(m);
write('masukan nilai d: '); readln(d);
if d > 0 then
d := d - 1
else
d := 59;
if (m > 0)then
m := m - 1
else
m := 59;
j := j - 1;
writeln('maka nilai j + m - d adalah: ',j + m - d);
readln();
end.
Tidak ada komentar:
Posting Komentar