Home computickets How to make several conditions if in Pascal

How to make several conditions if in Pascal

Author

Date

Category

The purpose of the command is the output of the smallest of the input numbers, but the program does not output anything.


Answer 1, Authority 100%

brackets. Use brackets and simple conditions in them:

var
  A, B, C, D: Integer;
Begin.
  readln (a);
  readln (b);
  READLN (C);
  READLN (D);
  if (a & lt; b) and (a & lt; c) and (a & lt; d) then
   Writeln (a);
  IF (B & LT; A) and (B & LT; C) and (B & LT; D) THEN
   Writeln (b);
  IF (C & LT; D and (C & LT; A) and (C & LT; B) THEN
   Writeln (C);
  if (D & LT; C) and (D & LT; A) and (D & LT; B) THEN
  Writeln (D);
end.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions