Advertisement
Mysoft

Untitled

Apr 26th, 2023
1,875
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let add x y = x + y
  2.  
  3. let () =
  4.     let age = ref 0 and
  5.     name = ref "" in
  6.            
  7.     print_string ( "what's your name? " );  
  8.     name := read_line ();
  9.    
  10.     print_string "what's your age? ";
  11.     age := int_of_string (read_line ());
  12.    
  13.     print_endline (
  14.         "hello " ^ !name ^
  15.         " i see you are " ^
  16.         ( string_of_int !age ) ^ " years old!"
  17.     );
  18.    
  19.     if (!age<18) then
  20.         print_endline ( "so you are a minor!" ) else
  21.         print_endline ( "why you are not in the school?" );
  22.    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement