tham khảo:
include<stdio.h>
#include<conio.h>
int main ()
{
float a,b;
printf("nhap so thu nhat: ");
scanf("%f",&a);
printf("\nnhap so thu hai: ");
scanf("%f",&b);
printf("\ntong: %.2f + %.2f = %.2f\n",a,b,a+b);
printf("hieu: %.2f - %.2f = %.2f\n",a,b,a-b);
printf("tich: %.2f * %.2f = %.2f\n",a,b,a*b);
printf("thuong: %.2f : %.2f = %.2f\n",a,b,a/b);
getch ();
return 0;
}
program bai2.1;
uses ctr;
var a,b,tong,hieu,tich,thuong:real;
begin
clrscr;
readln(a,b);
if b<>0 then tong:=a+b;
hieu:=a-b;
tich:=a*b;
thuong:=a/b;
writeln(a:0:0);
readln
end.