Viết chương trình Pascal nhập vào 2 số a, b in ra màn hình số lớn hơn. Dùng câu lệnh if... then...
Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.


Var a,b:real;
Begin
Write('a = ');readln(a);
Write('b = ');readln(b);
If a > b then write('So lon la ',a:10:2)
Else if b > a then write('So lon la ',b:10:2)
Else write('Hai so bang nhau');
Readln;
End.

Program solonhon;
var a,b: integer;
begin
write('Nhap a: '); readln(a);
write('Nhap b: '); readln(b);
if a> b then write(a);
if a<b then write(b);
if a=b then write('2 so bang nhau');
readln
end.

Var a,b,ta,tb,r,ucln:integer;
Begin
Write('a = ');readln(a);
Write('b = ');readln(b);
ta:=a;
tb:=b;
While tb <> 0 do
Begin
r:=ta mod tb;
ta:=tb;
tb:=r;
End;
ucln:=ta;
Write('UCLN(',a,'; ',b,') = ',ucln);
Readln
End.

program tong_so;
var
tong, so: integer;
begin
tong := 0;
while tong < 20 do
begin
write('Nhập số nguyên: ');
readln(so);
tong := tong + so;
end;
writeln('Tổng các số đã nhập là: ', tong);
end.

Var i,n:integer;
Begin
Write('n = ');readln(n);
Write('Day so tu 1 den ',n,' la ');
For i:=1 to n do write(i:8);
Readln
End.

a = int(input('Nhập số nguyên a: '))
b = int(input('Nhập số nguyên b: '))
c = int(input('Nhập số nguyên c: '))
if a > b and a > c:
print('Số lớn nhất là a =', a)
elif b > a and b > c:
print('Số lớn nhất là b =', b)
else:
print('Số lớn nhất là c =', c)

Bài 1:
uses crt;
var n,i,s:integer;
begin
clrscr;
write('Nhap n='); readln(n);
s:=0;
i:=1;
while i<=n do
begin
s:=s+i;
inc(i);
end;
writeln('Tong cac so trong khoang tu 1 den ',n,' la: ',s);
readln;
end.
Bài 2:
uses crt;
var n,i,s:integer;
begin
clrscr;
write('Nhap n='); readln(n);
s:=0;
i:=1;
while i<=n do
begin
s:=s+i;
i:=i+2;
end;
writeln('Tong cac so le trong khoang tu 1 den ',n,' la: ',s);
readln;
end.
Program HOC24;
var a,b: integer;
begin
write('Nhap a: '); readln(a);
write('Nhap b: '); readln(b);
if a> b then write(a);
if a<b then write(b);
if a=b then write('2 so bang nhau');
readln
end.