use of operator precedence in C#
For Example : Write a program to demonstrate the use of operator precedence.
class Program
{
public static void Main(string[] args)
{
int
x;
int
a = 7, b = 3, c = 2;
x = a + b * c; // here arithmetic problem is solved followed by precedence
Console.WriteLine("Result is After Solving:" + x);
Console.ReadLine();
}
}
Output:
Comments
Post a Comment