User Input
User Input
To accept input from user, We use Console
class Console
has a function called ReadLine()
which tells the OS to ask for user input. We shall discuss using
and classes later:
After we read it, we can convert the data into required format using Convert class:
Exercise
Ask the user for two his birth year in yyyy
format and calculate his age and display:
We could do the same for a decimal type number as well:
Exercise
Ask the user his weight and display it:
Last updated