how to print and display name and age?

Just starting out? Need help? Post your questions and find answers here.
samxxx
User
User
Posts: 10
Joined: Sun Oct 09, 2022 5:17 pm

how to print and display name and age?

Post by samxxx »

Code: Select all

EnableExplicit
EnableGraphicalConsole(#True)
Global Aname.s



OpenConsole()
PrintN(" ")
PrintN (" Enter your name?")

Aname.s = Input()
ClearConsole()
;--------------------------

PrintN (" Enter your age?")
b = Val(Input())



Input()
// Added Code-Tags (Kiffi)
Olli
Addict
Addict
Posts: 1251
Joined: Wed May 27, 2020 12:26 pm

Re: how to print and display name and age?

Post by Olli »

Code: Select all

EnableExplicit
EnableGraphicalConsole(#True)
Define Aname.s
Define Age.i



OpenConsole()
PrintN(" ")
PrintN (" Enter your name?")

Aname = Input()
ClearConsole()
;--------------------------

Print(" Enter your age?")
Age = Val(Input())

PrintN("So " + Aname + " is " + Str(Age) + " year(s) old.")

Input()
Post Reply