In this C# program, takes two integers form user. Then, the product of those two integers is stored in a variable and displayed on the console screen.
Variables are defined in the first row. In the next lines, values are assigned to these variables.
In the last line we print the result of processing on the screen.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | class Program { static void Main(string[] args) { int num1; int num2; int result; Console.Write("\n \n *** www.csharp-console-examples.com \n \n"); Console.Write(" --- C# Program to find product of Two Integers --- \n \n"); Console.Write("Enter first number:"); num1 = Convert.ToInt32(Console.ReadLine()); Console.Write("Enter Second number:"); num2 = Convert.ToInt32(Console.ReadLine()); result = num1 * num2; Console.Write("The product of two numbers is:" + result); Console.ReadLine(); } } |
Output:
You can find more similar examples of programming for this programming language in the site.