16.operator in c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace @operator.cs
{
class Program
{
static void Main(string[] args)
{
int a = 11, b = 12, c = 34;
Console.WriteLine("Addition = " + (a + b + c));
Console.WriteLine("Substraction = " + (a - b - c));
Console.WriteLine("Multiplication = " + (a * b * c));
Console.WriteLine("Division = " + ((a/b)+c));
if(a > b && a > c)
Console.WriteLine(a + " is greater ");
else if( b > a && b > c)
Console.WriteLine(b + " is greater");
else if( c > a && c > a)
Console.WriteLine(c + " is greater");
else
Console.WriteLine("All Are Eqal");
Console.Read();
Console.WriteLine();
if (b == c)
Console.WriteLine("Sub of b & c is " + (b - c));
else if (b >= c)
Console.WriteLine("add of b & c is " + (b + c));
else if (b <= c)
Console.WriteLine("Mul of b & c is " + (b * c));
else if (b != c)
Console.WriteLine("Div of b & c is " + (b / c));
int ans = (a > b) ? a : b;
Console.WriteLine(ans);
}
}
}
Comments
Post a Comment