C# Online Compiler
Example: Addition of Two Numbers in C# Program with Float Values
C
C++
C#
Java
Python
PHP
main.cs
STDIN
Run
// Addition of Two Numbers in C# Program with Float Values using System; public class W3CW { // @It's the driver function static public void Main (string[] args) { Console.WriteLine("Enter two float values::"); float p = float.Parse(Console.ReadLine()); float q = float.Parse(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.23 7.29
Output
Clear
ADVERTISEMENTS