Jump to content

User Input: Difference between revisions

no edit summary
(Modula-3)
No edit summary
Line 5:
=={{header|Ada}}==
{{works with|GCC|4.1.2}}
<lang ada>
function Get_String return String is
Line : String (1 .. 1_000);
Line 19:
-- may raise exception Constraint_Error if value entered is not a well-formed integer
end Get_Integer;
</adalang>
The functions above may be called as shown below
<lang ada>
My_String : String := Get_String;
My_Integer : Integer := Get_Integer;
</adalang>
 
=={{header|ALGOL 68}}==
Line 231:
 
=={{header|OCaml}}==
<lang ocaml>print_string "Enter a string: ";
let str = read_line () in
print_string "Enter an integer: ";
let num = read_int () in
Printf.printf "%s%d\n" str num</ocamllang>
 
=={{header|Pascal}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.