An Advanced Calculator in C# 5



The .Net Framework provides a Math class with a loads of mathematical functions like Sin, Cos, Tan, ASin, ACos, ATan, Floor, Ceiling, Power, Log, Ln etc. We can easily use them by simply referring to the Math functions. These Math class functions take suitable parameters and return appropriate datatypes which can be easily changed to Strings or Doubles. The conversion here done is with the help of Convert class.


Hello World Program For C #

This is a small program which shows the basic functionality of C#. The program contains 2 labels. The labels are shown to blink alternatively with the help of two timers. Whenever a timer is enabled, the other timer is relaxed and a label linked with the corresponding timer has its visible property set to true while the other label has its visible property set to false. This simple logic gives us the effect of alternative blinking of the labels. You can set the tick property of the timer to a suitable number. This gives the time in milliseconds between the blinks. A word of caution : do not simply copy paste codes written here instead type it in your IDE. For example to type in the code for the first timer timer1 , double click on the timer1 which gives you a fraction of code ready to begin with and then type in the code within the closed block of curly braces.