In the previous two posts “Hello C# and .Net Core” and “Do predefined types have different values in .Net Core?”; you first learned how to print some text on a terminal panel, and then you learned how to declare the variables adding some values to them. Show the text on the terminal panel is interesting, but it is not worth it if you do not enter some user data, and assign it to the variables in your program, and use them for your estimate. In this post, we are introducing the basic operators in the C# programming language. We will also say more about other operators, just so you know that they exist, and we will learn them in some other future posts because the beginners in C# program language will be not able to understand it now. There are many things you need to learn to be able to learn all the operators in the C# programming language. So, let’s not rush.
We can assume that you learned some basic operators from elementary school math. It is important to understand that the C# programming language has a lot more operators than you have learned from mathematics. Some operators are the same as those you have learned from math while others exist only in the C# programming language, especially in version 7.0. This means that some of the operators are new and do not exist in the older version of C# programming language. See first what all operator categories exist in the C# programming language in version 7.0. See the picture:
We will start with arithmetic operators. We will start our study of arithmetic operators with a simple small program in which you need to enter two integers. The program should accept user input and execute five arithmetic operations and display results.