VelizarAvramov

07. Greeting

Nov 5th, 2018
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.57 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _07._Greeting
  4. {
  5.     class Greeting
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             //Write a program that enters first name, last name and age and prints "Hello, <first name> <last name>. You are <age>
  10.             //years old.". Use interpolated strings.
  11.             string firstName = Console.ReadLine();
  12.             string secondName = Console.ReadLine();
  13.             int age = int.Parse(Console.ReadLine());
  14.  
  15.             Console.WriteLine($"Hello, {firstName} {secondName}. You are {age} years old.");
  16.         }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment