Answers for "adding two decimal point numbers in c#"

C#
2

add two numbers in c#

using System;

namespace Add{
	public class Program{

		public static int addition(int a, int b){
			return (a+b);
		}

		public static void Main(){
			int a,b;
			int sum;

			Console.Write("Enter first number: ");
			a = Convert.ToInt32(Console.ReadLine());

			Console.Write("Enter second number: ");
			b = Convert.ToInt32(Console.ReadLine());

			sum = addition(a,b);

			Console.WriteLine("Sum is: " + sum);
		}
	}
}
Posted by: Guest on August-28-2021
-1

decimal c# 2 digits

decimal.Round(yourValue, 2, MidpointRounding.AwayFromZero);
Posted by: Guest on February-09-2021

Code answers related to "adding two decimal point numbers in c#"

C# Answers by Framework

Browse Popular Code Answers by Language