Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ada 0.45 KB | None | 0 0
  1. with Ada.Text_IO;
  2. use Ada.Text_IO;
  3. procedure ejercicio_3 is
  4.    -- Definimos los tipos de datos del enunciado
  5.    type A is delta 0.001 range -10.00..150.00;
  6.    type B is digits 4 range -100.00..100.00;
  7.    -- Inicializamos variables
  8.    aux1:A:=-1.999;
  9.    aux2:B:=30.5432;
  10.    total:Float;
  11. begin
  12.    -- Calculamos la operación A + B
  13.    total:=Float(aux1)+Float(aux2);
  14.    -- Imprimimos el resultado por pantalla
  15.    Put_Line(total'Img);
  16. end ejercicio_3;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement