Рет қаралды 58,396
C# user input tutorial example explained
#C# #user #input
using System;
namespace MyFirstProgram
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("What's your age?");
String name = Console.ReadLine();
Console.WriteLine("What's your age?");
int age = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Hello " + name);
Console.WriteLine("You are " + age + " years old");
Console.ReadKey();
}
}
}