In this program, you’ll learn to print an integer number entered by the user in C#. The integer is stored in a variable using System, and is displayed on the screen using System.
Code: C# program to print integer entered by user
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | class Program { static void Main(string[] args) { int number; Console.Write("Enter a number:"); number = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("You entered :{0}",number); Console.ReadLine(); } } |
Output:
How do you get a program to store an unlimited amount of user typed data and to call it later or at any time without using an array or lists? It’s for a homework assignment.
https://www.csharp-console-examples.com/database/connecting-c-application-to-sqlite-select-insert-update-delete/
https://www.csharp-console-examples.com/winform/connecting-c-application-to-sql-databaseselect-insert-update-delete/