
Напишите программу на вычитание, деление и умножение (8-9 класс) На примере: program n_1 uses crt
var a, b, c: integar; begin writeln ('введите а: '); readln (а); writeln (введите b: '); readln (b); c:=a+b writeln ('сумма =', c); readkey; end.

Ответы на вопрос

uses crt;
var
a, b, c: integer;
d:real;
begin
writeln ('введите а: ');
readln (a);
writeln ('введите b: ');
readln (b);
c:=a+b;
writeln ('сумма =', c);
c:=a*b;
writeln('произведение = ',c);
if b=0 then
writeln('деление на 0')
else
begin
d:=a/b;
writeln('деление = ',d:4:2);
end;
readkey;
end.



Program for Subtraction, Division, and Multiplication in Pascal
Here is an example program in Pascal that performs subtraction, division, and multiplication:
```pascal program ArithmeticOperations; uses crt;
var a, b, c: integer;
begin writeln('Enter a:'); readln(a); writeln('Enter b:'); readln(b);
c := a - b; writeln('Subtraction result:', c);
c := a div b; writeln('Division result:', c);
c := a * b; writeln('Multiplication result:', c);
readkey; end. ```
This program prompts the user to enter two integers, `a` and `b`. It then performs the following operations:
1. Subtraction: `c := a - b` 2. Division: `c := a div b` 3. Multiplication: `c := a * b`
The results of each operation are displayed on the screen.
Please note that this program uses the `crt` unit for console input and output. The `readkey` procedure is used to wait for a key press before the program exits.
I hope this helps! Let me know if you have any further questions.


Топ вопросов за вчера в категории Информатика







Последние заданные вопросы в категории Информатика
-
Математика
-
Литература
-
Алгебра
-
Русский язык
-
Геометрия
-
Английский язык
-
Химия
-
Физика
-
Биология
-
Другие предметы
-
История
-
Обществознание
-
Окружающий мир
-
География
-
Українська мова
-
Информатика
-
Українська література
-
Қазақ тiлi
-
Экономика
-
Музыка
-
Право
-
Беларуская мова
-
Французский язык
-
Немецкий язык
-
МХК
-
ОБЖ
-
Психология
-
Физкультура и спорт
-
Астрономия
-
Кыргыз тили
-
Оʻzbek tili