Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Anonymous
Anonymous asked in Computers & InternetProgramming & Design · 9 years ago

How to solve this pascal programming task?

I'm totally new with programming, and my task is to enter three values (a, b, c) and to find the sum of the two smallest values entered. I guess i have to find which one is the biggest value but i don't know how to do that. Can anybody help me with this?

1 Answer

Relevance
  • 9 years ago
    Favorite Answer

    program sum_smallvalue;

    var num1, num2, num3 , sum : integer;

    begin

    write ('Please enter 3 integers :');

    read (num1,num2,num3);

    if (num1 > num2) and (num1 > num3) then

    begin

    sum := num2 + num3;

    writeln ('The sum of the smallest numbers entered is :',sum);

    end;

    if (num2 > num1) and (num2 > num3) then

    begin

    sum := num1 + num3;

    writeln ('The sum of the smallest numbers entered is :',sum);

    end;

    if (num3 > num1) and (num3 > num2) then

    begin

    sum := num1 + num2;

    writeln ('The sum of the smallest numbers entered is :',sum);

    end;

    readln;

    end.

Still have questions? Get your answers by asking now.