fork download
  1. /* PL/1 Program to add 123 and 456 */
  2.  
  3. ADDER: PROCEDURE OPTIONS(MAIN);
  4.  
  5. DECLARE NUM1 FIXED DECIMAL(3); /* Declare NUM1 as a 3-digit decimal */
  6. DECLARE NUM2 FIXED DECIMAL(3); /* Declare NUM2 as a 3-digit decimal */
  7. DECLARE SUM FIXED DECIMAL(4); /* Declare SUM as a 4-digit decimal to hold the result */
  8.  
  9. /* Initialize the numbers */
  10. NUM1 = 123;
  11. NUM2 = 456;
  12.  
  13. /* Calculate the sum */
  14. SUM = NUM1 + NUM2;
  15.  
  16. /* Display the result */
  17. PUT SKIP LIST('The sum of ', NUM1, ' and ', NUM2, ' is ', SUM);
  18.  
  19. END ADDER;
  20.  
Success #stdin #stdout 0s 5324KB
stdin
Standard input is empty
stdout
Standard output is empty