Dragon/Lessons/Getting Input

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Getting Input[edit | edit source]

We can get input from the keyboard using the readln function.

readln function[edit | edit source]


	select "std"

	a = readln()


	select "std"
	select "types"
    showln "Enter the first number :"
	a = int(readln())
    showln "Enter the second number :"
	b = int(readln())
	showln "Sum is : " + (a + b)


	Enter the first number : 3
	Enter the second number : 4
	Sum is : 7