0% found this document useful (0 votes)
6 views

C# Notes(Incomplete(Doing It for Access))

This document provides an introduction to C# programming, covering basic concepts such as string creation, data types (char, int, float, double, decimal, and bool), and basic operations. It explains how to store and retrieve data using literals and variables, as well as perform basic string formatting and operations on numbers. Additionally, it touches on the use of if statements and arrays in C#.

Uploaded by

Just Someone
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

C# Notes(Incomplete(Doing It for Access))

This document provides an introduction to C# programming, covering basic concepts such as string creation, data types (char, int, float, double, decimal, and bool), and basic operations. It explains how to store and retrieve data using literals and variables, as well as perform basic string formatting and operations on numbers. Additionally, it touches on the use of if statements and arrays in C#.

Uploaded by

Just Someone
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

C# Notes

1.Write your first code using C# (Get started with C#, Part 1)

Lesson 1: The Basics

Double quotation marks (“”) create strings

Console.WriteLine() = creates a new line on the console

Console.Write() = keeps writing on the same line

Lesson 2: Store and retrieve data using literal and variable values in C#

You use char (short for character) whenever you have a single alphanumeric
character for presentation (not calculation).

E.G.


If you want to display a numeric whole number (no fractions) value in the output
console, you can use an int (short for integer) literal

Use floating-point literals: A floating-point number is a number that contains a


decimal. C# supports 3 data types for decimal numbers: Float, Double and
Decimal

Float: To create a float literal, append the letter F after the number. Both capital
and lowercase F can be used. In this context, the F is called a literal suffix.

For example: Console.WriteLine(0.25F);

Float is used for the least precise values.

Double: To create a double literal, just enter a decimal number. The compiler
defaults to a double literal when a decimal number is entered without a literal suffix.

For example: Console.WriteLine(2.625);

Decimal: To create a decimal literal, append the letter m after the number. Both
capital and lowercase M work. In this context, the m is called a literal suffix

For example: Console.WriteLine(12.39816m);


The term bool is short for Boolean. In C#, they're officially referred to as "bool"

Bool = true or false


Example of an use of a variable:

Var
Lesson 3: Perform basic string formatting in C#
😎
Completed the challenge like a boss

Lesson 3: Perform basic operations on numbers in C#

The plus sign (+) can be used for basic operations for additions.

When put in a sentence with strings with pluses it would be referred as the
number the variable is assigned too

If u want to add a number to the variable in a sentence with strings just put the
variable and the number in parenthesis with a plus sign.
If statements:
Arrays:

You might also like