C# Online Compiler
Example: Addition of Two Numbers in C# Program with Integer Values
C
C++
C#
Java
Python
PHP
main.cs
STDIN
Run
// Addition of Two Numbers in C# Program with Integer Values using System; public class W3CW { // @It's the driver function static public void Main (string[] args) { Console.WriteLine("Enter two integer values::"); int p = Convert.ToInt32(Console.ReadLine()); int q = Convert.ToInt32(Console.ReadLine()); // It will calculate the sum int r = p + q; // It will print the final output Console.WriteLine("\nResult:: " + p + " + " + q + " = " + r); } }
5 7
Output
Clear
ADVERTISEMENTS