Check if the number is three-digit, in which the first digit is equal to the last. (In pascal)
August 18, 2021 | education
| The algorithm will be described in the PascalABC.Net programming language;
The program will first check the condition, and then output the result.
begin // start of the program;
var x: integer; // initialization of the variable x, which will contain the value of the number;
read (x); // read the number into the variable x;
if (x> 99) and (x <1001) and (x div 100 = x mod 10) then // check the condition (the first two conditions are checked for a three-digit number, the third condition is to check if the first and last digits match);
writeln (‘Yes’) else
writeln (‘No’);
end. // end of the program.
One of the components of a person's success in our time is receiving modern high-quality education, mastering the knowledge, skills and abilities necessary for life in society. A person today needs to study almost all his life, mastering everything new and new, acquiring the necessary professional qualities.