Answers for "how to do math in c#"

C#
2

math operations in c#

Console.WriteLine("" + x);
            Console.WriteLine("x +=" + (x += 5));
            Console.WriteLine("x -=" + (x -= 5));
            Console.WriteLine("x *=" + (x *= 5));
            Console.WriteLine("x /=" + (x /= 5));
            Console.WriteLine("x %=" + (x %= 3));
            Console.WriteLine("x &=" + (x &= 5));
            Console.WriteLine("x ^=" + (x ^= 5));
            Console.WriteLine("x >>=" + (x >>= 5));
            Console.WriteLine("x <<=" + (x <<= 5));
Posted by: Guest on May-10-2021
1

basic math functions in c#

int a = 10;
int b = 5;
Console.WriteLine("------------Basic math functions----------------");
Console.WriteLine("Multiplication:- ");
Console.WriteLine(a*b);
Console.WriteLine("Subtraction:- ");
Console.WriteLine(a-b);
Posted by: Guest on October-30-2021

C# Answers by Framework

Browse Popular Code Answers by Language