C# Online Compiler
Example: Addition of Two Numbers in C# Program with Minimum Variables
C
C++
C#
Java
Python
PHP
main.cs
STDIN
Run
// Addition of Two Numbers in C# Program with Minimum Variables 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()); Console.Write("\nResult:: " + p + " + " + q + " = "); // It will calculate the sum p = p + q; // It will print the final output Console.WriteLine(p); } }
5 7
Output
Clear
ADVERTISEMENTS