Guest User

Untitled

a guest
Aug 9th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ada 0.43 KB | None | 0 0
  1. with Ada.Text_IO;
  2.  
  3. procedure Hello is
  4.    function bunnyEars(num : Integer) return Integer is
  5.    begin
  6.       if num = 0 then
  7.         return 0;
  8.       else
  9.          return 2*num;
  10.       end if;
  11.    end bunnyEars;
  12.    
  13.    type Real is digits 5;
  14.    num : Real;
  15.      
  16. begin
  17.    num := 2.531251251212512131241241241241512124124;
  18.    Ada.Text_IO.Put_Line(Real'Image(num));
  19.    Ada.Text_IO.Put_Line(Integer'Image(bunnyEars(5)));
  20. end Hello;
Add Comment
Please, Sign In to add comment