Program Sara_Trang;
Uses crt;
Var x:integer;
Begin
Write('Nhap vao mot so nguyen : '); Readln(x);
If x MOD 2=0 Then
Writeln('So vua nhap vao la so chan')
Else Writeln('So vua nhap vao la so le');
Readln
End.
1.
var a:integer;
Begin
writeln('nhap a'); readln(a);
if a mod 2=0 then write ('so chan') else write ('so le');
readln
end.
Quá dễ
bài 1:
uses crt;
var a:integer;
begin
clrscr;
write('nhap so a='); readln(a);
if a mod 2=0 then writeln(a,' la so chan')
else writeln(a,' la so le');
readln;
end.
Bài 2:
uses crt;
var a,b:integer;
begin
clrscr;
write('a='); readln(a);
write('b='); readln(b);
If(a=0) then If(b=0) then Writeln(' Phuong trinh co vo so nghiem') Else writeln(' Phuong tring vo nghiem') Else Writeln('Phuong trinh co nghiem x=',-b/a: 4: 2);readln;
end.