Make a program calculating the sum of the digits of a three-digit number a. Enter the value a from the keyboard

Make a program calculating the sum of the digits of a three-digit number a. Enter the value a from the keyboard Example of input: 375 Example of output: The sum of the digits of the number 375 is equal to 15 2) Make a program that receives the ‘flip’ of the three-digit number a. Enter the value a from the keyboard Example input: 375 Example output: 573

program summ_invers;
var n, n1, n2, n3: integer;
begin
writeln (‘Enter a three-digit number’);
readln (n);
n1: = n div 100;
// integer division by 100 equals the number of hundreds

n2: = (n mod 100) div 10;
// integer division by 10, the remainder of the division of the number by 100
// equal to the number in the tens place

n3: = n mod 10;
// the remainder of dividing a number by 10 is equal to the number of ones

writeln (‘The sum of the digits of the number’, n, ‘is equal to’, n1 + n2 + n3);
writeln (‘The inverted number’, n, ‘will be a number’, n3 * 100 + n2 * 10 + n1);
end.



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.