1Saying Hello

The “Hello, World” program is the first program you learn to write in many languages, but it doesn’t involve any input.

So create a program that prompts for your name and prints a greeting using your name.

Example Output

 
What is your name? Brian
 
Hello, Brian, nice to meet you!

Constraint

  • Keep the input, string concatenation, and output separate.

Challenges

  • Write a new version of the program without using any variables.

  • Write a version of the program that displays different greetings for different people. This would be a good challenge to try after you’ve completed the exercises in Chapter 4, Making Decisions and Chapter 7, Data Structures.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.68.81