C++:
#include <bits/stdc++.h>
using namespace std;
int main(){
float a,b;
cout << "Nhap chieu dai: "; cin >> a;
cout << "Nhap chieu rong: "; cin >> b;
float s = a * b;
cout << "Dien tich hinh chu nhat: " << s;
return 0;
}
Pascal:
uses crt;
var a,b:extended;
s:real;
begin
clrscr;
write('Nhap chieu dai: '); readln(a);
write('Nhap chieu rong: '); read(b);
s:=a * b;
writeln('Dien tich: ',s:0:2);
readln
end.
Python:
a = float(input("Nhap chieu dai: "))
b = float(input("Nhap chieu rong: "))
print("Dien tich: ",a * b)