Вопрос задан 03.09.2018 в 05:46. Предмет Информатика. Спрашивает Мацеевский Данил.

Описать процедуру PIFAGOR которая выводит на экран таблицу умножения на заданное число

0 0
Перейти к ответам

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

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Крахмальный Алексей.
Var a,b,c:integer;
beginwriteln('введите число на которое умножить');
readln(a);
for b:=1 to 10 do
begin
writeln(a,'*',b,'=',a*b);
end;
end.
0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Procedure to Display a Multiplication Table in Pascal

To create a procedure in Pascal that displays a multiplication table for a given number, you can follow these steps:

1. Declare the procedure and its parameters. 2. Use a loop to iterate through the numbers from 1 to 10 (or any desired range). 3. Inside the loop, calculate the product of the given number and the current iteration number. 4. Display the multiplication expression and its result on the screen.

Here's an example of how the procedure can be implemented in Pascal:

```pascal program Pifagor;

procedure DisplayMultiplicationTable(number: integer); var i, product: integer; begin for i := 1 to 10 do begin product := number * i; writeln(number, ' * ', i, ' = ', product); end; end;

begin // Call the procedure with the desired number DisplayMultiplicationTable(5); end. ```

In this example, the procedure `DisplayMultiplicationTable` takes an integer parameter `number`, which represents the number for which the multiplication table will be displayed. The loop iterates from 1 to 10, calculating the product of `number` and the current iteration value. The `writeln` statement is used to display the multiplication expression and its result on the screen.

When you run this program, it will display the multiplication table for the number 5, as follows:

``` 5 * 1 = 5 5 * 2 = 10 5 * 3 = 15 5 * 4 = 20 5 * 5 = 25 5 * 6 = 30 5 * 7 = 35 5 * 8 = 40 5 * 9 = 45 5 * 10 = 50 ```

You can modify the program to display the multiplication table for any desired number by changing the parameter passed to the `DisplayMultiplicationTable` procedure.

Please note that the code provided is a general example and may need to be adapted to the specific Pascal compiler or development environment you are using.

0 0

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

Последние заданные вопросы в категории Информатика

Задать вопрос