Programming Fundamentals/Variable Examples CSharp

Overview
The following examples demonstrate data types, arithmetic operations, and input in C#.

Output
Integer i = 1234567890 Double d = 1.23456789012345 String s = string Boolean b = True

Discussion
Each code element represents:
 * begins a comment
 * allows references to  and   without writing   and
 * begins the Data Types program
 * begins a block of code
 * begins the main function
 * defines an integer variable named i
 * ends each line of C# code
 * defines a double floating-point variable named d
 * defines a string variable named s
 * defines a Boolean variable named b
 * assign literal values to the corresponding variables
 * calls the standard output write line function
 * ends a block of code

Output
a = 3 b = 2 a + b = 5 a - b = 1 a * b = 6 a / b = 1 a % b = 5

Discussion
Each new code element represents:
 * represent addition, subtraction, multiplication, division, and modulus, respectively.

Output
Enter Fahrenheit temperature: 100 100° Fahrenheit is 37.7777777777778° Celsius

Discussion
Each new code element represents:
 * reads the next line from standard input
 * converts the input to a double floating-point value