In this Program takes two numbers from the user. Then first number divides to second.
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.
Codes:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | int num1; int num2; float result; Console.Write("\n \n *** www.csharp-console-examples.com *** \n \n"); Console.Write("Enter first number:"); num1 = Convert.ToInt32(Console.ReadLine()); Console.Write("Enter Second number:"); num2 = Convert.ToInt32(Console.ReadLine()); result =(float) num1 / num2; Console.Write("The division of two numbers is:" + result); Console.ReadLine(); |
Result:
You can find more similar examples of programming for this programming language in the site.