How To with C#
This program will generate two sets of 10 random numbers using C#. Two arrays are used to hold two different sets of random numbers. The product of those random numbers are then stored in a third array. The output is displayed in a message box.
This program demonstrates the use of the split method to populate a new array. The user will enter his/her first name and the results will show the user’s last name followed by a comma then the first name in uppercase.
In this program the user will be able to enter any number of values. The output will then display at the end of the program and let the user know the percentage each individual value contributes to the total. This program uses an array list and displays how to set a regular array value to an Array List via the ConvertTo() method.
This console program allows the user to enter a series of numbers. The program then counts the distinct values and the number of times the distinct values occured in the series of numbers entered.
An occasion may arise where you want to display an escape character sequence on your screen, such as \t or \n that initiates tab spacing and newline respectively. So how can you avoid showing tabbed spacing or skipping to a new line and instead actually show the character combination of escape characters such as \t and \n?
The trick is to write your string using an @-string literal (a.k.a. verbatim string literal) versus a traditional string literal.
Example One (traditional string literal):
This code example will allow the user to enter an integer value and it will determine whether the number is prime or not. Thanks go out to my little bro for the logic behind this.
static void PrimNum()
This code provides an example of how to calculate compound interest with C#. The code below is used in a console application but can be used in windows forms and web applications. This example also uses the Pow() method in the Math class to achieve the computation.
Below is example code on how to create a multiplication table using C# (C Sharp) based on two user input parameters. The following code is for console applications but can be utilized in windows forms applications and web pages.