-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cs
More file actions
50 lines (40 loc) · 1.46 KB
/
Copy pathtest.cs
File metadata and controls
50 lines (40 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System.Collections.Specialized;
using System.Text;
// using System.Diagnostics;
// using System.Text;
// string name = "FRIEND";
// Console.WriteLine($"MERRY CHRISTMAS, {name}!");
// using System;
// class Program
// {
// static void Main()
// {
// // Declare variables
// string name;
// int age;
// double height;
// // Get string input
// Console.Write("Enter your name: ");
// name = Console.ReadLine();
// // Get integer input with validation
// Console.Write("Enter your age: ");
// while (!int.TryParse(Console.ReadLine(), out age) || age < 0)
// {
// Console.Write("Invalid input. Please enter a valid non-negative age: ");
// }
// // Get double input with validation
// Console.Write("Enter your height in meters (e.g., 1.75): ");
// while (!double.TryParse(Console.ReadLine(), out height) || height <= 0)
// {
// Console.Write("Invalid input. Please enter a positive number: ");
// }
// // Output the collected data
// Console.WriteLine("\n--- Profile Summary ---");
// Console.WriteLine($"Name: {name}");
// Console.WriteLine($"Age: {age}");
// Console.WriteLine($"Height: {height} m");
// }
// }
Console.WriteLine("Enter your name: ");
string name = Console.ReadLine();
Console.WriteLine($"Hello, {name}!");