0% found this document useful (0 votes)
62 views2 pages

C# .Net Practical

Uploaded by

rajputdhruv385
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views2 pages

C# .Net Practical

Uploaded by

rajputdhruv385
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1.

Develop a console application that prompts the user to enter various values like Name,
Age, and City. Once the user inputs the data, display it back on the console.

using System;

class Program

static void Main()

// Get Name

[Link]("Enter your name: ");

string name = [Link]();

// Get Age (no validation)

[Link]("Enter your age: ");

int age = Convert.ToInt32([Link]());

// Get City

[Link]("Enter your city: ");

string city = [Link]();

// Display the information

[Link]("\n--- User Information ---");

[Link]("Name: " + name);

[Link]("Age: " + age);

[Link]("City: " + city);

[Link]("\nPress any key to exit...");

[Link]();
}

You might also like