Skip to content

C Programming For Beginners Lecture 2 Coding our First Application in NET Core Console

FurkanGozukara edited this page Oct 26, 2025 · 1 revision

C# Programming For Beginners - Lecture 2: Coding our First Application in .NET Core Console

C# Programming For Beginners - Lecture 2: Coding our First Application in .NET Core Console

image Hits Patreon BuyMeACoffee Furkan Gözükara Medium Codio Furkan Gözükara Medium

YouTube Channel Furkan Gözükara LinkedIn Udemy Twitter Follow Furkan Gözükara

C# Programming For Beginners Lectures (2/14) will teach you #CSharp #programming from 0 to beginner / intermediate level. So if you have no idea about programming, if you don't know anything about #coding, or if you want to become a Software Engineer, please subscribe and follow our courses.

Discord ➡️ https://bit.ly/SECoursesDiscord

Patreon ➡️ https://www.patreon.com/SECourses

Technology Playlist (30+ Tutorial / Guide / News / Review Videos) ⤵️

https://www.youtube.com/playlist?list=PL_pbwdIyffsnkay6X91BWb9rrfLATUMr3

Stable Diffusion Playlist (30+ Tutorial / Guide Videos) ⤵️

https://www.youtube.com/playlist?list=PL_pbwdIyffsmclLl0O144nQRnezKlNdx3

Please join discord, mention me and ask me any questions. Thank you for like, subscribe, share and Patreon support. I am open to private consulting with Patreon subscription.

Full playlist of this course ⤵️

https://www.youtube.com/playlist?list=PL_pbwdIyffskoSXySh0MdiayPJsBZ7m2o

You can watch for free our C# Programming, ASP .NET Core MVC programming, Machine Learning and Software Engineering related courses on our playlists page ⤵️

https://www.youtube.com/@SECourses/playlists

GitHub code repository of this course (source codes of the lectures) ⤵️

https://github.com/FurkanGozukara/CSE105-2020-introduction-to-programming

Lecture 2/14:

  • How to compose single-line and multi-line comment

  • Console.WriteLine method

  • Special keywords list, operators list, special characters list, string escape sequences

  • Syntax of C# programming language

  • Data types: char, string, boolean, decimal, double, float, byte, sbyte, short/Int16, ushort/UInt16, int/UInt32, uint/UInt32, long/Int64, ulong/UInt64

  • Usage of $ sing in front of strings

  • String format

  • bit, byte, megabyte, gigabyte, etc.

  • Representation of integral numbers in base 2 as bits

  • Representation of numbers in other bases

Introduction:

C# (pronounced C Sharp) is a modern, object-oriented programming language that was designed by Microsoft as part of its .NET framework. It is a popular choice for developing applications that run on the Windows operating system. In this article, we will discuss some of the basic concepts and syntax of C# programming language.

Single-line and Multi-line Comment:

A comment is a section of code that is ignored by the compiler. It is used to add notes and explanations to your code. In C#, there are two types of comments: single-line and multi-line. Single-line comments start with two forward slashes (//) and continue until the end of the line. Multi-line comments start with /* and end with */. Multi-line comments can span multiple lines.

Console.WriteLine Method:

The Console.WriteLine method is used to write a line of text to the console. It is often used for debugging purposes, as it allows you to see the value of a variable or the result of an operation. The syntax of the Console.WriteLine method is as follows:

Console.WriteLine("text");

Special Keywords List, Operators List, and Special Characters List:

C# has a number of special keywords, operators, and special characters that are used to control the flow of the program and to perform operations. Some of the most common keywords include if, else, while, for, switch, case, and break. Some of the most common operators include +, -, *, /, %, and =. Some of the most common special characters include \n (newline), \t (tab), and \ (backslash).

String Escape Sequences:

Escape sequences are used to represent special characters in a string. For example, the newline character (\n) is used to create a new line in a string. Other escape sequences include \t (tab), \r (carriage return), and \ (backslash). To use an escape sequence in a string, you must precede it with a backslash ().

Syntax of C# Programming Language:

The syntax of C# programming language is similar to that of other programming languages. It is based on a series of statements that are executed in a specific order. Each statement is composed of one or more keywords, operators, and/or variables.

Data Types:

C# supports a variety of data types, including char, string, boolean, decimal, double, float, byte, sbyte, short/Int16, ushort/UInt16, int/UInt32, uint/UInt32, long/Int64, and ulong/UInt64. These data types are used to represent different types of data, such as characters, numbers, and Boolean values.

Usage of $ Sign in Front of Strings:

The $ sign is used in C# to indicate that a string is an interpolated string. An interpolated string is a string that contains placeholders for values that will be replaced at runtime. To use an interpolated string, you must precede the string with a $ sign and enclose the placeholders in curly braces ({}) and include the variable name inside the braces.

String Format:

String format is used to format strings in a specific way. This can be used to display numbers with a certain number of decimal places, to add leading zeros to a number, or to format a date in a specific way.

Video Transcription

  • 00:00:00 Hello Dear Students.

  • 00:00:01 Welcome to the Lecture 2 of Introduction to Programming with C-Sharp course.

  • 00:00:07 Today we are going to start programming our first software.

  • 00:00:11 We are going to use Microsoft Visual Studio.

  • 00:00:15 Last week I have told you to install it and shown how to install it.

  • 00:00:21 So let's find our software here.

  • 00:00:24 I am going to need to taskbar and start.

  • 00:00:28 So I am going to click from start.

  • 00:00:31 So this is the first interface of Visual Studio.

  • 00:00:36 We are going to create a new project.

  • 00:00:38 Ok.

  • 00:00:39 From here you see there are a lot of templates.

  • 00:00:42 I am going to use.NET Core console application at the beginning.

  • 00:00:48 There is.NET Core and.NET Framework.

  • 00:00:51 Let me show you.

  • 00:00:53 So these two are different.

  • 00:00:55 How different?

  • 00:00:57 You see console app.NET Framework is C-Sharp, Windows and console.

  • 00:01:03 However.NET Core console is C-Sharp, Linux, Mac OS, Windows and console.

  • 00:01:08 So if you use the latest framework of Microsoft.NET platform it is core and it supports Mac OS

  • 00:01:18 and Linux as well for console applications.

  • 00:01:21 Ok.

  • 00:01:22 I am going to select next.

  • 00:01:23 And I am going to select the directory where I want it.

  • 00:01:27 I am going to put it into our production to programming.

  • 00:01:31 And let's create here lecture code.

  • 00:01:34 Lectures.

  • 00:01:35 And I am going to name this as Lecture 1.

  • 00:01:39 Ok.

  • 00:01:40 Ok.

  • 00:01:41 So the main interface is opened.

  • 00:01:45 We are using an IDE which was integrated development environment.

  • 00:01:49 We are using Microsoft Visual Studio as an IDE.

  • 00:01:54 And IDE makes our job much much simpler and easier to develop software to write code.

  • 00:02:03 Ok.

  • 00:02:04 So we will start from the zero point.

  • 00:02:10 And let's just run it to run the project.

  • 00:02:13 Currently this is a project that will work.

  • 00:02:15 I can click this button or I can click start debugging button.

  • 00:02:19 I am going to click start debugging button.

  • 00:02:22 It is the same.

  • 00:02:23 This button runs the application in debug mode with any CPU.

  • 00:02:28 Ok.

  • 00:02:29 So you see the console has opened and it writes hello world.

  • 00:02:34 This part is auto generated.

  • 00:02:38 So this is the part we have printed on the console screen.

  • 00:02:41 And I am going to press a key.

  • 00:02:44 So there is a namespace system class static void and console write line.

  • 00:02:50 This is our whole software.

  • 00:02:53 We will see each one of them by the time.

  • 00:02:56 So right now this main method is where our application starts with.

  • 00:03:03 Ok.

  • 00:03:04 So let's start with console write line command.

  • 00:03:08 In C sharp the sign text is everything is written inside classes.

  • 00:03:14 Ok.

  • 00:03:15 So this is the method and this method is written inside this class.

  • 00:03:20 And what is above class that can be another class or namespace.

  • 00:03:25 And you see everything is encapsulated with curly brackets.

  • 00:03:29 Do you see this curly brackets.

  • 00:03:31 It starts and it ends.

  • 00:03:33 It starts and it ends.

  • 00:03:34 It starts and it ends.

  • 00:03:37 Always a curly bracket has to be start and end.

  • 00:03:40 It is same for parentheses as well.

  • 00:03:45 If a parentheses is starting it ends.

  • 00:03:47 If a square bracket starts it ends.

  • 00:03:50 Ok.

  • 00:03:51 So parentheses curly brackets and square brackets are all special characters.

  • 00:03:59 And strings these double quotes are also special characters.

  • 00:04:06 So you have to be careful with them.

  • 00:04:08 Let's see C sharp special character list.

  • 00:04:13 Ok.

  • 00:04:14 Let's type like this.

  • 00:04:15 So this may be the best page.

  • 00:04:18 Ok.

  • 00:04:19 So which characters are special characters.

  • 00:04:22 Ok.

  • 00:04:23 There is not a list.

  • 00:04:25 Maybe keyboards operators maybe.

  • 00:04:27 Ok.

  • 00:04:28 So there are special keywords.

  • 00:04:29 Abstract, break, char, byte.

  • 00:04:32 You see these are the special keywords.

  • 00:04:35 When you type these they mean something.

  • 00:04:38 For example let's say there is a static word in this page.

  • 00:04:43 When you type static it means the initialization type of the method or class or object.

  • 00:04:52 If there is void it means the return type of the method.

  • 00:04:56 You can see the void in this page as well.

  • 00:04:59 So all of these are special keywords that are used in C sharp.

  • 00:05:04 And each word means something.

  • 00:05:06 Ok.

  • 00:05:07 So you see now I have a horizontal cursor bar.

  • 00:05:11 I don't want to see that.

  • 00:05:13 I want to see the entire line in a single line.

  • 00:05:20 How do I do that?

  • 00:05:21 I go to the view properties window or not that tools options and there is text or text

  • 00:05:31 editor.

  • 00:05:32 Perhaps yes there is all languages and there is word drop.

  • 00:05:34 When I click selected you see now this line has become a single line.

  • 00:05:40 It makes our job easier to read entire lines.

  • 00:05:44 So this is a special keyword list.

  • 00:05:46 You see I have put double of this character in front of it.

  • 00:05:52 This means that make this line as a command.

  • 00:05:57 So this line is not executed when the software runs.

  • 00:06:01 So you see it is it has become green.

  • 00:06:04 And so this is a command line.

  • 00:06:06 There are alternative ways of commenting.

  • 00:06:08 When I select this and there is command selection when I click this it comments that line.

  • 00:06:17 Alternatively you can do this and it can be a multi line command.

  • 00:06:23 This is a multi line command and I am going to operators.

  • 00:06:27 All the operators are these these characters are all operators plus plus plus star percent.

  • 00:06:38 You can see all about all expressions about operators.

  • 00:06:42 These are the basic operators.

  • 00:06:44 Let's just we will see all of these by the time going to compose a single line command.

  • 00:06:50 See when I type like this software shows an error.

  • 00:06:54 It says there is no such special keyword as operators.

  • 00:06:59 So whatever you type has to be either a special keyword or either to be a string.

  • 00:07:07 You can't just type letters without string encapsulation.

  • 00:07:14 So I'm going to make this a single line command.

  • 00:07:16 When I click this it becomes a single line command.

  • 00:07:19 I'm going to take some notes.

  • 00:07:22 Let's continue.

  • 00:07:24 Special characters.

  • 00:07:25 There are two special characters in strings which are add and dollar.

  • 00:07:30 We will see them as well.

  • 00:07:31 I'm going to add to our commands.

  • 00:07:34 One second guys my girls.

  • 00:07:36 OK so special characters.

  • 00:07:38 I will show you what they mean as well.

  • 00:07:40 And there are two special characters of in string and dollar value.

  • 00:07:45 And what else there are.

  • 00:07:49 OK.

  • 00:07:50 So far this is enough.

  • 00:07:51 We will see as we continue to the lessons.

  • 00:07:55 So I have made commands.

  • 00:07:57 You can select them.

  • 00:07:59 Copy them.

  • 00:08:00 And like here or even it shows open URL even it is a command.

  • 00:08:08 And check as your home.

  • 00:08:11 OK.

  • 00:08:12 So as I said everything is written inside curly brackets.

  • 00:08:15 So this is a method.

  • 00:08:17 What are methods.

  • 00:08:19 Let's look for some formal definition.

  • 00:08:22 This is Turkish.

  • 00:08:24 I'm going to make it English.

  • 00:08:25 One second.

  • 00:08:27 OK methods.

  • 00:08:28 Let's read the formal definition of method in official document.

  • 00:08:33 A method is a code block that contains a series of statements.

  • 00:08:37 A program causes the statements to be executed by calling the method and specifying any required

  • 00:08:43 method arguments.

  • 00:08:44 In C sharp every executed instruction is performed in the context of a method.

  • 00:08:49 The main method is the entry point for every C sharp application and it's called by the

  • 00:08:53 common language runtime CLR when the program is started.

  • 00:08:58 Sorry about that.

  • 00:08:59 Probably you heard both desktop and microphone.

  • 00:09:03 OK.

  • 00:09:04 I have put my earphones on so I am going to make it read again.

  • 00:09:08 A method is a code block that contains a series of statements.

  • 00:09:13 A program causes the statements to be executed by calling the method and specifying any required

  • 00:09:18 method arguments.

  • 00:09:20 In C sharp every executed instruction is performed in the context of a method.

  • 00:09:25 The main method is the entry point for every C sharp application and it's called by the

  • 00:09:29 common language runtime CLR when the program is started.

  • 00:09:33 So what does this mean.

  • 00:09:35 A method is a code block that contains series of statements.

  • 00:09:39 In this case this is our main method which is called when the application is first started.

  • 00:09:46 OK.

  • 00:09:47 So first method called is main.

  • 00:09:51 In this main method another method is called.

  • 00:09:53 Which one is it.

  • 00:09:55 Yes.

  • 00:09:56 Yes it is console right line.

  • 00:09:57 So console is a class of system library a namespace and inside this console class we

  • 00:10:05 are calling right line method.

  • 00:10:07 What does this right line method do.

  • 00:10:09 When I hover it I see that writes the specified string value followed by the current line

  • 00:10:15 terminator to the standard output.

  • 00:10:17 OK.

  • 00:10:18 So this is what does right line method do.

  • 00:10:22 Right line method takes some arguments.

  • 00:10:24 OK.

  • 00:10:25 Which arguments does it take.

  • 00:10:30 When I delete it and once again my girl again I want to see what type of inputs I can provide

  • 00:10:38 to the console dot right line method.

  • 00:10:40 When I click here like this you see it shows 18 input types that it can take.

  • 00:10:47 OK.

  • 00:10:48 So a method is called block that contains series of statements.

  • 00:10:52 OK.

  • 00:10:53 Sorry about that.

  • 00:10:54 So I want to see what and let's read this and specifying any required method arguments.

  • 00:11:01 So right line method can take 18 arguments which are.

  • 00:11:07 Let's see every one of them to see argument types that it can take.

  • 00:11:11 I am deleting the bracket and opening it again.

  • 00:11:15 So it shows every one of type the arguments it can take.

  • 00:11:19 It can take empty arguments so if you don't provide anything it just writes an empty line.

  • 00:11:27 Let's try it.

  • 00:11:28 I'm providing nothing.

  • 00:11:29 OK.

  • 00:11:30 And then I'm going to provide string.

  • 00:11:32 OK.

  • 00:11:33 So this is string.

  • 00:11:34 Strings are always starting with double quota and ending with double quota.

  • 00:11:40 So if you want to make something with a string.

  • 00:11:45 A string starts with double quota and ends with quota.

  • 00:11:48 When you call a method it always starts with a bracket and ends with a bracket.

  • 00:11:54 OK.

  • 00:11:55 So I am providing a string data type and what other methods it can take.

  • 00:12:01 I am copying and pasting this and opening the bracket.

  • 00:12:05 OK.

  • 00:12:06 So we have provided nothing and we have provided string.

  • 00:12:08 OK.

  • 00:12:09 Bool value.

  • 00:12:10 So what is bool type?

  • 00:12:11 Bool is a type that can be true or false.

  • 00:12:14 So I am going to provide bool value.

  • 00:12:17 How am I going to do that?

  • 00:12:19 I am going to say I am providing bool value and writing like this plus just let's first

  • 00:12:27 define a bool value.

  • 00:12:29 To compose a bool value I'm going to type bool my bool value equal to true.

  • 00:12:38 So this is a bool value.

  • 00:12:39 A bool value can be only true or false.

  • 00:12:43 It's a subtract type.

  • 00:12:44 OK.

  • 00:12:45 We will see more about them and I'm going to edit like this.

  • 00:12:48 So what does this plus mean?

  • 00:12:51 This plus is a string operator which is concatenating string and another string.

  • 00:12:56 In this case I am concatenating string with an object.

  • 00:13:01 The object here is bool value.

  • 00:13:03 So it will be converted to string.

  • 00:13:05 And let's start.

  • 00:13:07 Let's start our application to see I can hit F5 button or click here or click here.

  • 00:13:13 I'm going to use here.

  • 00:13:15 So you see it is saying I am providing string data type here.

  • 00:13:19 I didn't provide anything here so it is just an empty line.

  • 00:13:23 And here I have provided bool value which was true so it has converted true into the

  • 00:13:29 string as true.

  • 00:13:30 OK.

  • 00:13:31 So here we are using write line method.

  • 00:13:34 What does that mean?

  • 00:13:35 That means that it writes the provided data to the console and then ends that line and

  • 00:13:43 make the cursor start from the next line.

  • 00:13:45 I will show that as well.

  • 00:13:47 So let's continue.

  • 00:13:48 Here I have made string concat operations.

  • 00:13:52 String plus operator.

  • 00:13:54 So this is a plus operator.

  • 00:13:55 Let's go to the next.

  • 00:13:57 OK.

  • 00:13:58 One another thing.

  • 00:13:59 When you are working with C sharp every command ends with semicolon.

  • 00:14:05 OK.

  • 00:14:06 So after every command after calling every method after defining every data or compose

  • 00:14:13 object or class you have to end it with semicolon.

  • 00:14:17 But methods do not end with semicolon when you are constructing them.

  • 00:14:22 When you like here when you are defining a method it doesn't end with a semicolon.

  • 00:14:28 Methods and classes when you are defining them not initializing an object of them they

  • 00:14:33 are not ending with semicolon.

  • 00:14:35 So you have to stick to the syntax of the programming language strictly for any language

  • 00:14:42 any programming language.

  • 00:14:44 And in C sharp it is case sensitive.

  • 00:14:48 So if you write this code like this it wouldn't work.

  • 00:14:51 You see now it is underlined with red and it says console does not contain a definition

  • 00:14:58 for write line because it is case sensitive and has to be written exactly like that.

  • 00:15:05 And it shows potential fixes.

  • 00:15:07 I am clicking that it says change right line to right line which is the correct typing

  • 00:15:12 of the method.

  • 00:15:13 When I click that it changes it and it fixes the error.

  • 00:15:17 OK.

  • 00:15:18 So I'm doing this very good and putting it again to see more input types.

  • 00:15:23 It is taking a character value.

  • 00:15:25 OK.

  • 00:15:26 So let's see what is character type.

  • 00:15:28 I am defining it as car.

  • 00:15:30 So when you are defining a character it is single quarter.

  • 00:15:35 This character has to be exactly a single character.

  • 00:15:40 It cannot be more than one character like this.

  • 00:15:43 You see too many characters in the character letter.

  • 00:15:47 OK.

  • 00:15:48 So my character let's say I'm going to write it like that again.

  • 00:15:52 I'm going to like OK.

  • 00:15:54 You see character type.

  • 00:15:56 OK.

  • 00:15:57 OK.

  • 00:15:58 OK.

  • 00:15:59 OK.

  • 00:16:00 Let's see another input type of input option of right line.

  • 00:16:03 But it can take a character buffer.

  • 00:16:06 OK.

  • 00:16:07 We don't need that at the moment.

  • 00:16:08 Decimal value.

  • 00:16:10 So what is a decimal value?

  • 00:16:11 A decimal value is a value that can have after 1000 operators and it is floating point numeric

  • 00:16:21 types.

  • 00:16:22 Let's get it read.

  • 00:16:24 The floating point numeric types represent real numbers.

  • 00:16:27 All floating point numeric types are value types.

  • 00:16:31 They are also simple types and can be initialized with literals.

  • 00:16:34 All floating point numeric types support arithmetic comparison and equality operators.

  • 00:16:40 OK.

  • 00:16:41 So there are three type of floating point types float which can be in between these

  • 00:16:46 ranges and it takes four bytes in memory double type which can be in between these ranges.

  • 00:16:53 It can take it is eight bytes and decimals which can be between in these ranges and it

  • 00:17:01 is 16 bytes.

  • 00:17:03 So what what differences the highest number they can represent differences like here and

  • 00:17:12 double can represent more higher numbers.

  • 00:17:16 Precision is lower than decimals.

  • 00:17:19 You see what does precision mean?

  • 00:17:22 Precision means that the numbers that it can hold after a point separator.

  • 00:17:36 So let's give some examples.

  • 00:17:39 My decimals is 412.0.

  • 00:17:40 It says I have to put OK so it is not able to understand the decimals because by default

  • 00:17:49 it is double to make it understand as a decimals.

  • 00:17:53 I am putting M word and I'm going to compose a double.

  • 00:17:59 So I have put same numbers for both of the variables but there will be a difference.

  • 00:18:06 What difference there will be?

  • 00:18:08 Precision.

  • 00:18:09 What does precision mean?

  • 00:18:10 Precision is the number that is after zero.

  • 00:18:15 OK so it already says let's run it.

  • 00:18:19 All right.

  • 00:18:20 So these numbers I'm going to quit.

  • 00:18:22 I did CTRL C entered as his number.

  • 00:18:27 You see the precision has significantly lost after this.

  • 00:18:32 All this precision is lost because it can hold maximum like this a decimals.

  • 00:18:38 And let's see in the double case.

  • 00:18:40 So this is the original number double provided number and it is printed as like this.

  • 00:18:47 So much more precision is lost.

  • 00:18:50 OK if you need precision higher than they you need to look for other data types.

  • 00:18:56 OK so this is the difference.

  • 00:18:59 And let's continue what else it can take.

  • 00:19:01 OK so decimals and all these special keywords are in the special keyword list.

  • 00:19:08 Bull, char, decimals, double.

  • 00:19:11 Let's look at them if you want.

  • 00:19:12 I'm going to open this link.

  • 00:19:14 OK.

  • 00:19:15 Say you see char.

  • 00:19:16 OK.

  • 00:19:17 You see double.

  • 00:19:18 OK.

  • 00:19:19 You see bull and you see decimals.

  • 00:19:21 All these are special keywords.

  • 00:19:23 I'm going to continue to show you more.

  • 00:19:25 The console right line.

  • 00:19:27 What does it takes?

  • 00:19:28 It takes float value.

  • 00:19:29 Float is the same but it can only hold lesser precision and maximum value.

  • 00:19:37 Let's make example of that as well.

  • 00:19:39 It will require me to put an suffix.

  • 00:19:43 Suffix means the end character and my float.

  • 00:19:46 Let's see the float value.

  • 00:19:48 Let's also increase this maximum value so you will have more understanding.

  • 00:19:51 I'm going to increase the maximum like this.

  • 00:19:54 OK.

  • 00:19:55 It's already out of range so not needed.

  • 00:19:59 Let's print it.

  • 00:20:01 OK.

  • 00:20:02 So the precision of float is the lowest one.

  • 00:20:04 I'm going to copy all of this and paste into here.

  • 00:20:07 OK.

  • 00:20:08 So print it as like that.

  • 00:20:12 Double print it as like this and float print it as like this.

  • 00:20:16 You see the precision has been decreased each time.

  • 00:20:19 I can also print the maximum value.

  • 00:20:22 How can I do that?

  • 00:20:23 I can do that like double max.

  • 00:20:26 Let's make it like max value of.

  • 00:20:29 I'm going to use another syntax.

  • 00:20:31 When we look at the special characters we saw these two characters which were dollar

  • 00:20:37 and end character.

  • 00:20:38 So I'm going to put here a dollar value.

  • 00:20:41 When I put dollar value curly brackets inside string comes a special character.

  • 00:20:47 OK.

  • 00:20:48 So I can write like this.

  • 00:20:50 This will show the max value of a double struct.

  • 00:20:54 And let's see max value of float.

  • 00:20:58 And let's see max value of.

  • 00:21:00 I'm going to put another empty line here.

  • 00:21:03 Let's run it.

  • 00:21:05 This will put another empty line.

  • 00:21:07 This dollar make this a string.

  • 00:21:10 Let's show the difference of dollar.

  • 00:21:13 When I remove the dollar sign in front of string.

  • 00:21:16 This is the beginning of string.

  • 00:21:18 You see it became also a string.

  • 00:21:20 Not a special character anymore.

  • 00:21:23 OK.

  • 00:21:24 When I run it.

  • 00:21:26 You see now it typed as a string.

  • 00:21:28 It typed as a number.

  • 00:21:30 It typed as a number and it typed as a number.

  • 00:21:32 So max value of double is.

  • 00:21:35 This one is written mathematically.

  • 00:21:36 Without scientific notation.

  • 00:21:37 It was written in scientific notation.

  • 00:21:41 OK.

  • 00:21:42 Like this.

  • 00:21:43 So apparently this is the way.

  • 00:21:45 I will make it write without scientific definition.

  • 00:21:49 How can I do that?

  • 00:21:50 I will do that as.

  • 00:21:51 I will convert this value to the string with another format.

  • 00:21:56 Like.

  • 00:21:57 And let's run it.

  • 00:21:58 OK.

  • 00:21:59 So.

  • 00:22:00 Max value of double is this one.

  • 00:22:02 It looks like it doesn't preserve.

  • 00:22:03 OK.

  • 00:22:04 This is an overkill for now.

  • 00:22:05 We can ignore it.

  • 00:22:07 But you get the idea.

  • 00:22:08 It is already two big numbers.

  • 00:22:10 OK.

  • 00:22:11 What else there is?

  • 00:22:13 Double.

  • 00:22:15 It takes.

  • 00:22:16 Integer value.

  • 00:22:17 Integers are 32 bits signed value as.

  • 00:22:20 So let's type the max value of integers.

  • 00:22:24 Which is pretty low integers.

  • 00:22:25 And I'm going to type.

  • 00:22:28 OK.

  • 00:22:29 So this is the max value of integers.

  • 00:22:30 You can also type integer like this.

  • 00:22:33 When I just type number there.

  • 00:22:36 It's automatically integers.

  • 00:22:38 Because it's a.

  • 00:22:41 Let's say.

  • 00:22:42 Integer value.

  • 00:22:43 It is not a voting point.

  • 00:22:46 If I type it like this.

  • 00:22:47 Comes a.

  • 00:22:49 Double value.

  • 00:22:51 OK.

  • 00:22:52 So what else we can.

  • 00:22:55 I can take.

  • 00:22:56 Long value.

  • 00:22:57 Object value.

  • 00:22:58 String value.

  • 00:22:59 Uint.

  • 00:23:00 Ulong.

  • 00:23:01 String format.

  • 00:23:02 And other parameters.

  • 00:23:03 You get the idea so far.

  • 00:23:04 So.

  • 00:23:05 This is our main command.

  • 00:23:06 Main method.

  • 00:23:08 And.

  • 00:23:09 These are the arguments that it can take.

  • 00:23:11 You can.

  • 00:23:12 Run this.

  • 00:23:14 Program from command line.

  • 00:23:15 And provide arguments to it.

  • 00:23:18 For this lesson I will not show that.

  • 00:23:20 This is right line.

  • 00:23:23 Command.

  • 00:23:24 Let's see.

  • 00:23:26 Right command of the console.

  • 00:23:27 So I'm going to clear console from here.

  • 00:23:30 Can I do that?

  • 00:23:32 I will.

  • 00:23:33 Show it.

  • 00:23:34 Console dot clear.

  • 00:23:35 Clear my console.

  • 00:23:37 And I will write another.

  • 00:23:38 Line.

  • 00:23:40 OK.

  • 00:23:41 So the console cleared.

  • 00:23:42 And the new line is written.

  • 00:23:44 So I will just show the console dot write.

  • 00:23:46 What does write do?

  • 00:23:48 Write to the same line.

  • 00:23:51 Does not put a new line character.

  • 00:23:56 And make the console at the beginning of the line.

  • 00:24:00 And I'm going to write another one.

  • 00:24:02 And I start this.

  • 00:24:04 OK.

  • 00:24:05 So you see this line will continue.

  • 00:24:06 This will be in the same line.

  • 00:24:08 OK.

  • 00:24:09 So.

  • 00:24:10 What do I need to move to the next line?

  • 00:24:13 I can make it like here.

  • 00:24:15 So this will take me to the next line.

  • 00:24:19 OK.

  • 00:24:20 And let's run it.

  • 00:24:21 You see now this is in a new line.

  • 00:24:23 OK.

  • 00:24:24 So this is a special character inside string.

  • 00:24:28 A special literal in a string.

  • 00:24:31 That moves our string to the new line.

  • 00:24:33 There are also more special literals.

  • 00:24:37 Let's find them.

  • 00:24:38 OK.

  • 00:24:39 String escape sequences.

  • 00:24:40 These are all those special characters.

  • 00:24:43 That behaves different than a regular string.

  • 00:24:48 OK.

  • 00:24:49 Let's make example of them.

  • 00:24:51 So single cote with this one.

  • 00:24:55 And this is an escape character.

  • 00:24:58 OK.

  • 00:24:59 Let's make example.

  • 00:25:00 Type like this.

  • 00:25:01 However.

  • 00:25:02 And I'm going to here.

  • 00:25:04 You may look features.

  • 00:25:06 So I want to say a cote from someone.

  • 00:25:09 OK.

  • 00:25:10 You see my string is not working anymore.

  • 00:25:14 Why?

  • 00:25:15 Because csharp sees that your string started here and ended here.

  • 00:25:19 But it didn't start again here.

  • 00:25:22 OK.

  • 00:25:23 So this is a problem for csharp.

  • 00:25:25 When a string starts with double cote which is a special escape character.

  • 00:25:31 It has to end with a double cote and start again double cote.

  • 00:25:36 So to use double cotes in my string which is a special character.

  • 00:25:40 What do I need to do?

  • 00:25:41 I need to put an escape character in front of it which is this one.

  • 00:25:45 So I have escaped all cotes.

  • 00:25:47 This can be done with this as well.

  • 00:25:50 Not this one.

  • 00:25:51 OK.

  • 00:25:52 This is the only way.

  • 00:25:53 So when I run my application.

  • 00:25:57 I will see that you see I can put now double cotes inside my string.

  • 00:26:02 What other special characters that there are backslash.

  • 00:26:06 If you want to put a backslash in your string.

  • 00:26:12 So stays unrecognized escape sequence.

  • 00:26:15 How do I fix it?

  • 00:26:16 If I pull backslash it becomes a string literal.

  • 00:26:19 But it will be printed only as one.

  • 00:26:22 Because one backslash escapes this escape character.

  • 00:26:27 So what more there is.

  • 00:26:29 These are not very important.

  • 00:26:32 Yes.

  • 00:26:33 This means when both of these bring together it becomes a new line.

  • 00:26:38 This is carriage return.

  • 00:26:40 So what is carriage return?

  • 00:26:42 It returns the cursor to the end.

  • 00:26:45 There is horizontal top.

  • 00:26:46 OK.

  • 00:26:47 This is important.

  • 00:26:48 Let's go horizontal top.

  • 00:26:50 So I want to show you the difference.

  • 00:26:55 So this will put a top like in a word.

  • 00:26:58 OK.

  • 00:26:59 You see these are written like this with just empty character and these have top character

  • 00:27:04 between them.

  • 00:27:05 OK.

  • 00:27:06 So what else there is.

  • 00:27:07 There is vertical top.

  • 00:27:09 Let's try that.

  • 00:27:10 Vertical top uses V. OK.

  • 00:27:12 And let's see how it works.

  • 00:27:15 So vertical top is printed like this on console.

  • 00:27:18 It may be printed different on another console or winform application.

  • 00:27:25 And there is some other unicode escape sequences and others.

  • 00:27:28 You will see more of them in the future.

  • 00:27:32 And string interpolation which I was showing you.

  • 00:27:36 Dollar sign.

  • 00:27:37 Composite string.

  • 00:27:38 Yeah.

  • 00:27:39 Let's show composite formatting.

  • 00:27:40 The console right line also formats supports string format.

  • 00:27:45 I'm going to.

  • 00:27:48 OK.

  • 00:27:49 So let's format a string.

  • 00:27:53 So when I print it will be printed like this.

  • 00:27:57 And I will compose a format string.

  • 00:28:01 String format takes several different types of arguments.

  • 00:28:05 It can take each of these.

  • 00:28:07 You see.

  • 00:28:08 I will provide string and then objects as arguments.

  • 00:28:12 So my string has two arguments.

  • 00:28:14 Take the string and I will provide objects.

  • 00:28:18 My school number let's say it is 250 and my score is 97.

  • 00:28:24 OK.

  • 00:28:25 And I will print my format string a string.

  • 00:28:31 Let's print it console.

  • 00:28:33 Let's see it.

  • 00:28:34 So basically is my school number is curly brackets 0.

  • 00:28:38 OK.

  • 00:28:39 My graduation score is curly brackets 1.

  • 00:28:41 So format string.

  • 00:28:42 My school number is 250.

  • 00:28:44 My graduation score is 97.

  • 00:28:45 Can I format my string with just one value.

  • 00:28:49 Let's try it.

  • 00:28:50 And it will throw an error.

  • 00:28:54 Exception unhandled.

  • 00:28:55 An exception happened because we have done something incorrectly.

  • 00:28:59 Wrongfully.

  • 00:29:00 We provided a format which takes two arguments at least.

  • 00:29:06 And we provided only one argument.

  • 00:29:08 So it said that index 0 based must be greater than or equal to 0 or less than the size of

  • 00:29:14 the argument list.

  • 00:29:15 So this will throw an error.

  • 00:29:17 I'm going to comment it.

  • 00:29:18 Otherwise it will throw an error every time and I'm going to say version 2.

  • 00:29:24 For version 2 I will provide many more arguments.

  • 00:29:26 What will happen.

  • 00:29:29 Arguments after this will be ignored.

  • 00:29:31 So it takes argument index as the index written here.

  • 00:29:37 So this is index 0.

  • 00:29:38 This is index 0.

  • 00:29:40 This is index 1.

  • 00:29:41 This is index 1.

  • 00:29:42 We will see more about indexes.

  • 00:29:44 I'm going to type it in this version 2.

  • 00:29:48 So version 2 will be same as version 1 because it will just take the first two values.

  • 00:29:52 Okay.

  • 00:29:53 And the rest will be ignored.

  • 00:29:55 Console.WriteLine also provides string format like this.

  • 00:29:58 Let's look for the inputs it can take.

  • 00:30:02 You see it can take string format and objects as an array.

  • 00:30:06 We will see about arrays as well.

  • 00:30:09 So my 0, 1, 2.

  • 00:30:12 So I have to provide at least three arguments.

  • 00:30:15 Three data.

  • 00:30:16 This string format which I will be providing.

  • 00:30:21 And let's say let's run it.

  • 00:30:23 It is working.

  • 00:30:25 How did it work?

  • 00:30:26 It worked because WriteLine has an overload method that accepts string format and object

  • 00:30:34 argument.

  • 00:30:35 Okay.

  • 00:30:36 This is how it worked.

  • 00:30:37 I could have used this method as well.

  • 00:30:39 This strategy.

  • 00:30:40 This approach as well.

  • 00:30:41 I can use this approach as well.

  • 00:30:42 These are all features of my Console.WriteLine method.

  • 00:30:47 Features of C-Sharp.

  • 00:30:50 Okay.

  • 00:30:51 What else to show there is for this lesson.

  • 00:30:55 So let's see about more variable types.

  • 00:30:58 And I will be starting from basics to most common data types.

  • 00:31:05 Let's say data types.

  • 00:31:06 So data types of this.

  • 00:31:08 Okay this is a decent article recently updated.

  • 00:31:11 There are classes and objects.

  • 00:31:14 And okay this is advanced.

  • 00:31:17 Okay let's start with first numeric types.

  • 00:31:21 Okay numerical types.

  • 00:31:22 Let's start with that.

  • 00:31:24 So I'm going to make it read.

  • 00:31:26 The integral numeric types represent integer numbers.

  • 00:31:30 All integral numeric types are value types.

  • 00:31:32 They are also simple types and can be initialized with literals.

  • 00:31:36 All integral numeric types support arithmetic, bitwise logical, comparison, and equality

  • 00:31:43 operators.

  • 00:31:44 So we will have idea about these operators and features.

  • 00:31:50 Let's start with S-byte.

  • 00:31:52 So S-byte can be between minus 128 to 127.

  • 00:31:58 So it's a signet 8-bit integer.

  • 00:32:00 What does signet mean?

  • 00:32:02 Signet means that it can be either positive or negative.

  • 00:32:06 Okay so I will start with an S-byte.

  • 00:32:09 I'm going to clear our console.

  • 00:32:12 Okay and we'll just compose an S-byte.

  • 00:32:15 And I will make it okay.

  • 00:32:19 I can just write an S-byte.

  • 00:32:21 No need to write.

  • 00:32:24 I will just define the data types so you will know them.

  • 00:32:28 It is taking, let's read it in English.

  • 00:32:31 S-byte is a struct type.

  • 00:32:33 We will see about them in future.

  • 00:32:35 It is in 16.

  • 00:32:37 So it uses, it just uses 8-bit memory.

  • 00:32:42 Because it is 8-bit integer.

  • 00:32:44 And there is byte.

  • 00:32:46 So let's say, this is also equal to this.

  • 00:32:51 Oh not this.

  • 00:32:52 There is also one byte in memory.

  • 00:32:55 There is short.

  • 00:32:57 Let's write.

  • 00:32:58 It can be this.

  • 00:32:59 So it takes two bytes in memory.

  • 00:33:01 16-bit.

  • 00:33:02 This is, short is also equal to Uint.

  • 00:33:09 You see since I didn't type capitalized int.

  • 00:33:13 It is giving error.

  • 00:33:14 As I said it is case sensitive.

  • 00:33:16 16 equal to short.

  • 00:33:19 And there is, let's say, Ushort.

  • 00:33:22 Which means it is unsigned.

  • 00:33:24 I will show you what does unsigned and signed mean.

  • 00:33:28 We'll see about them.

  • 00:33:29 I will show them.

  • 00:33:30 So this is equal to Uint, equal to short.

  • 00:33:34 They are same thing.

  • 00:33:35 Uint 16 is same as Ushort.

  • 00:33:39 Just different notation.

  • 00:33:40 Nothing else.

  • 00:33:41 Okay.

  • 00:33:42 Okay.

  • 00:33:43 So what else there is?

  • 00:33:44 There is integers.

  • 00:33:45 So these are integral numeric types.

  • 00:33:47 I am going to show you.

  • 00:33:49 Integral means there is no voting numbers.

  • 00:33:51 There is no points.

  • 00:33:53 Okay.

  • 00:33:54 Integer which is one of the most used one.

  • 00:33:56 Okay.

  • 00:33:57 Equal to 4 bytes in memory.

  • 00:33:59 Integer is equal to int.

  • 00:34:01 So they mean the same thing.

  • 00:34:04 I can type int 32 instead of integer.

  • 00:34:07 It is the same.

  • 00:34:08 No difference.

  • 00:34:09 And there is Uint.

  • 00:34:14 It is unsigned.

  • 00:34:15 Okay.

  • 00:34:16 There is more.

  • 00:34:17 Long.

  • 00:34:18 This is this one.

  • 00:34:19 Sign it.

  • 00:34:20 For integer it is equal to 8 bytes in memory.

  • 00:34:23 Okay.

  • 00:34:24 Long is equal to.

  • 00:34:25 Long is equal to 4.

  • 00:34:28 And there is Ulong.

  • 00:34:31 So it can be up to this number.

  • 00:34:33 This 8 bytes in memory.

  • 00:34:35 See if you use unsigned it cannot get a negative value.

  • 00:34:39 It can only hold positive value.

  • 00:34:41 However the range is doubled.

  • 00:34:44 Because one byte is reserved to determine whether that number is positive or negative.

  • 00:34:52 I will show that.

  • 00:34:54 Okay.

  • 00:34:55 So we have shown all of the integral numeric types of C sharp.

  • 00:34:59 I know that you wonder what does this byte means or bit means.

  • 00:35:06 Let's start with a simple example.

  • 00:35:08 In computer everything is stored as zeros and ones.

  • 00:35:13 If you have watched the previous video series I have shown you in here.

  • 00:35:18 You will have an idea of what I mean.

  • 00:35:21 I am going to open our repository page.

  • 00:35:25 And let's open our repository.

  • 00:35:28 There is an important computer science playlist.

  • 00:35:33 And I open this.

  • 00:35:34 It requires me to download it.

  • 00:35:36 I will download it.

  • 00:35:37 Open it.

  • 00:35:38 And when I click this link you will get this channel.

  • 00:35:42 Okay.

  • 00:35:43 And in this channel they explain this here.

  • 00:35:49 Numbers and letters with binary.

  • 00:35:51 So if you watch this you will see that how numbers are represented with binary.

  • 00:35:56 Okay.

  • 00:35:57 Like here.

  • 00:35:59 So these numbers are represented like this.

  • 00:36:04 It is about base 2.

  • 00:36:07 You know the base 10 and base 2.

  • 00:36:10 You must have seen them in the mid school and in the high school.

  • 00:36:17 Okay.

  • 00:36:18 So we represent number one.

  • 00:36:22 Let's start with it.

  • 00:36:23 I will start it by this one in base 10.

  • 00:36:27 Okay.

  • 00:36:28 So how we write it in base 2.

  • 00:36:32 We write it in base 2 like this.

  • 00:36:35 Zero.

  • 00:36:36 It will be one multiply zero times zero.

  • 00:36:42 So this is how it is written in base 2.

  • 00:36:45 Okay.

  • 00:36:46 And if I write number 2 I write it like this in base 2.

  • 00:36:53 And number 2 is what it is equal to.

  • 00:36:57 So we can write it as in 8 bits 0 0 0.

  • 00:37:05 Write it in 8 bits 0 0 0 0 0 1.

  • 00:37:07 So you see I have 8 bits.

  • 00:37:10 Each bit can be either 0 or 1.

  • 00:37:15 Which are 0 or 1 because CPUs or RAM memories are composed of transistors.

  • 00:37:24 If you watch these video series you will understand them better.

  • 00:37:27 But I am trying to explain it to you with the most basic way.

  • 00:37:32 So computers are composed of transistors and transistors hold data either they are 0 or

  • 00:37:39 1.

  • 00:37:40 So basically everything we see on the computer everything we do on the computer are 0s and

  • 00:37:48 1s.

  • 00:37:49 It is hard to explain in a short time.

  • 00:37:51 That is why I am telling you to watch these video series to understand that.

  • 00:37:57 You see they have made many video series just to explain what are these.

  • 00:38:03 So and each transistor is called as bits or let's say yeah we may say that.

  • 00:38:11 So 8 bits is 0s or 1s.

  • 00:38:15 This is how number 1 is represented in base 2.

  • 00:38:23 Why base 2?

  • 00:38:24 Because in base 2 there are 2 numbers.

  • 00:38:28 0 or 1 in base 0 or 1 0 in base 4 there are 4 numbers 0 1 2 4.

  • 00:38:38 So this is how it is.

  • 00:38:40 I think you know this from math lessons math courses you have taken.

  • 00:38:45 So in base 10 there are 10 numbers which are 1 2 3 4 5 6 9 starts from 0.

  • 00:38:54 So this is in base.

  • 00:38:56 So each bit is in base 2.

  • 00:38:59 They can be like this.

  • 00:39:01 So this is what is taken in memory.

  • 00:39:05 I bet you know that you have 4 GB of RAM memory.

  • 00:39:10 You heard that.

  • 00:39:11 So 4 GB RAM memory.

  • 00:39:13 Let's start to complete it.

  • 00:39:15 Cool to 4 plus 1 GB equals to.

  • 00:39:28 Let's calculate this for you.

  • 00:39:33 Let's check this.

  • 00:39:38 Okay, I know the reason.

  • 00:39:45 Probably each one of these is taken into consideration as integers.

  • 00:39:51 So to fix that, I'm going to add this literal.

  • 00:39:55 This literal means that it is 64-bit integer, not 32-bit integer.

  • 00:40:00 And just let's write line equal to...

  • 00:40:03 So, 4 gigabytes RAM memory is equal to this number of bits.

  • 00:40:09 Or this is this amount of bytes.

  • 00:40:11 When we multiply this number of bytes with it, I will just do it for you.

  • 00:40:17 Plus 8, you see this number, this number written on R. So, 1 byte is equal to 8 bits.

  • 00:40:25 Let's write it here, and so on.

  • 00:40:28 You can look for about...

  • 00:40:30 Okay, there are numbers here.

  • 00:40:34 You can learn more about them in here.

  • 00:40:39 I'm going to put that.

  • 00:40:41 Okay, so 2 is equal to in base 2, which is this.

  • 00:40:44 And it is written as 000010.

  • 00:40:49 And let's say number 13 is equal to...

  • 00:40:53 Or let's say number 2 is equal to base 2.

  • 00:40:59 I will calculate it.

  • 00:41:00 It can be like this.

  • 00:41:03 2 over 5 plus 2 over 1.

  • 00:41:08 Right?

  • 00:41:09 So, what will it be?

  • 00:41:10 It will be 000010.

  • 00:41:13 Okay, let's see if we've written it correctly.

  • 00:41:16 So, this is 2 over 1, 2 over 2, 2 over 3, 2 over 4, 2 over 5.

  • 00:41:23 Okay, this one.

  • 00:41:24 So, this is how it is written in base 2.

  • 00:41:28 It's byte.

  • 00:41:29 First is 2 over 0.

  • 00:41:33 Second is 2 over 1.

  • 00:41:35 Okay, the third is...

  • 00:41:38 It is actually equals to 0 over 2 over 0 plus 1 over 1 plus 0, 2 over 2 and plus this and

  • 00:41:48 2 over 3.

  • 00:41:49 So, this 0 is this 0.

  • 00:41:54 This 1 is this 1.

  • 00:41:57 This 0 is this 0.

  • 00:42:00 Try to understand this.

  • 00:42:03 This is some basic of future science.

  • 00:42:07 And this 0 is the third 0.

  • 00:42:10 2 over 2.

  • 00:42:13 This 0 is 2 over 3 plus.

  • 00:42:16 And this 0 is 2 over 4.

  • 00:42:19 And this one is here.

  • 00:42:21 2 over 5.

  • 00:42:22 It continues.

  • 00:42:23 And 2 over 6.

  • 00:42:24 And 2 over 7.

  • 00:42:25 So, what can we write maximum?

  • 00:42:28 We can write maximum 8-bit number is equal to 1, 1, 1, 1, 1, 1.

  • 00:42:35 Which is equal to 1 over 1, 1, 1, 1, 1, 1, 1.

  • 00:42:43 And which is equal to 1 plus 2 plus 4 plus plus 16 plus 2 plus 6.

  • 00:42:50 So, it is equal to how much?

  • 00:42:52 Yes, it is equal to max of unsigned integers.

  • 00:42:56 So, here.

  • 00:42:57 So, this is this, this, this, this, this, this.

  • 00:43:02 And this is this.

  • 00:43:04 And this is.

  • 00:43:05 So, it is equal to 205.

  • 00:43:07 To make it signed.

  • 00:43:09 To make it signed, we have to use bit to determine sign.

  • 00:43:13 In signed, this would be equal to in signed mode.

  • 00:43:18 Okay, so 1 is negative, 0 is positive.

  • 00:43:21 First left mode indicates the sign.

  • 00:43:23 Let's write it like this.

  • 00:43:25 In signed mode, this is this.

  • 00:43:28 And in signed mode, this is this one.

  • 00:43:31 It is why short is up to this bit.

  • 00:43:36 2 bytes, 16 bits.

  • 00:43:38 And integer is this.

  • 00:43:40 I will show you an example in a better way.

  • 00:43:45 Okay, let's say.

  • 00:43:47 U will be number equal to.

  • 00:43:50 I will convert this to base 2.

  • 00:43:53 Let's type it like this.

  • 00:43:55 Oh, not U in.

  • 00:43:56 Too long.

  • 00:43:57 Okay, like.

  • 00:43:59 And I am going to base number 2.

  • 00:44:02 Base 2 bits.

  • 00:44:03 Okay, like this.

  • 00:44:05 And I am going to type the base.

  • 00:44:11 So, yes.

  • 00:44:13 It will be like this.

  • 00:44:15 Okay, like this.

  • 00:44:17 Okay, like this.

  • 00:44:19 So, I have explicitly find the type of these numbers.

  • 00:44:25 This is explicit definition.

  • 00:44:27 And when I run the code.

  • 00:44:30 Okay, you see this number is represented like this.

  • 00:44:33 How many characters there are?

  • 00:44:34 There are exactly 24.

  • 00:44:37 Let's make more examples if you want.

  • 00:44:40 I will show each type.

  • 00:44:42 Short number 1 is.

  • 00:44:44 Let's say 6B.

  • 00:44:46 There were number 1.

  • 00:44:48 It is short.

  • 00:44:49 So, short is actually in 16.

  • 00:44:51 I will make it 16.

  • 00:44:53 You see now this is just a string.

  • 00:44:55 So, I put color of front of it.

  • 00:44:58 And it is like that.

  • 00:44:59 And I am going to using both works.

  • 00:45:01 Because they are both same.

  • 00:45:02 And 16.

  • 00:45:03 And I am going to provide in 13.

  • 00:45:06 In variable 2.

  • 00:45:07 This will cause problems.

  • 00:45:09 I am going to type it as 13 or int.

  • 00:45:15 And now we will see both of them.

  • 00:45:19 Okay, so int 64 is written like this.

  • 00:45:22 Int 16 is like.

  • 00:45:24 And int 22 is like this.

  • 00:45:26 Why?

  • 00:45:27 Because it reduces the remaining zeros from the string.

  • 00:45:32 So, let's make it in max value.

  • 00:45:35 Let's make it max value.

  • 00:45:37 And when I run.

  • 00:45:38 You see all are here.

  • 00:45:41 Oh, I had to use this one here.

  • 00:45:45 Otherwise it wouldn't work.

  • 00:45:46 So, I will write the length of these numbers.

  • 00:45:51 How am I going to do that?

  • 00:45:53 I am going to make it as length 22 plus length.

  • 00:45:57 Since this is a string.

  • 00:45:59 I can get length of it.

  • 00:46:01 Okay, so I am composing a string.

  • 00:46:04 And getting length.

  • 00:46:05 Let's make it this.

  • 00:46:07 And get length.

  • 00:46:09 Okay, so.

  • 00:46:10 We will see how many bits they are taking.

  • 00:46:12 Okay, length is 36 bits.

  • 00:46:17 And length is 15 bits.

  • 00:46:19 Why?

  • 00:46:20 Because it is signet.

  • 00:46:21 And length is 31 bits.

  • 00:46:23 Because it is signet.

  • 00:46:25 First letter is zero.

  • 00:46:27 And the rest of the letters are not written here.

  • 00:46:30 I can make it.

  • 00:46:32 If I make it maximum number.

  • 00:46:35 Let's make it maximum number.

  • 00:46:36 So, it will be like here.

  • 00:46:39 Okay, so now the length is 64 bits.

  • 00:46:41 Because since it is signet.

  • 00:46:47 So, in C sharp.

  • 00:46:48 I guess the first number is one for positive numbers.

  • 00:46:51 Not zero.

  • 00:46:52 Because this is 64.

  • 00:46:55 And these are 15.

  • 00:46:57 So, for U long.

  • 00:46:59 It is only one I guess.

  • 00:47:02 Oh, it is 64 bits.

  • 00:47:04 Because it is U long.

  • 00:47:05 What was the U mean?

  • 00:47:07 U mean meant that it is unsignet.

  • 00:47:11 Since it is unsignet.

  • 00:47:12 It is 63.

  • 00:47:13 If it was signet.

  • 00:47:14 It will be 63.

  • 00:47:15 Let's try with signet number.

  • 00:47:16 And I will signet number.

  • 00:47:18 You will get it.

  • 00:47:21 And, okay.

  • 00:47:22 This will be 63 characters.

  • 00:47:25 63 bits.

  • 00:47:27 Because it is signet.

  • 00:47:28 Okay, yes.

  • 00:47:29 You see it is signet. 63 bits.

  • 00:47:30 Okay.

  • 00:47:31 So, unsignet was this.

  • 00:47:32 The double of.

  • 00:47:34 Okay, so you should make practice about this.

  • 00:47:37 And understand it.

  • 00:47:39 Try to understand so far what we have shown in this lesson.

  • 00:47:44 Don't be afraid.

  • 00:47:47 As we progress through courses.

  • 00:47:49 Through lectures.

  • 00:47:51 You will understand much more.

  • 00:47:53 So, please watch this video at least two times.

  • 00:47:57 Try to understand everything we have shown here.

  • 00:48:00 And we have shown.

  • 00:48:02 Think format.

  • 00:48:03 Okay, what else we have shown.

  • 00:48:06 By the way, these ints are all capitalized.

  • 00:48:19 It matters.

  • 00:48:21 You have to type exactly.

  • 00:48:22 Oh, not capitalized.

  • 00:48:24 Otherwise, you will get errors.

  • 00:48:27 These are important.

  • 00:48:29 These are long.

  • 00:48:31 Okay.

  • 00:48:32 For example.

  • 00:48:33 What is the representation of base 5?

  • 00:48:36 How do we represent number 12 in base 5?

  • 00:48:40 We represent it like.

  • 00:48:41 How do we represent it?

  • 00:48:44 Actually, we can't represent number 12 in base 5.

  • 00:48:49 Because it is not a factor of base 5.

  • 00:48:53 However, we can represent number 30 in base 5.

  • 00:48:56 How would it be?

  • 00:48:57 It would be like this.

  • 00:48:59 Let's say 8 bits.

  • 00:49:00 And 1 and 1.

  • 00:49:03 Why?

  • 00:49:04 It would be equal to 5.

  • 00:49:05 I mean 1.

  • 00:49:06 Oh, wait, wait.

  • 00:49:07 I'm getting confused here.

  • 00:49:09 So, how do I represent number 12 in base 5?

  • 00:49:13 I can represent it, of course.

  • 00:49:15 I have 4 numbers.

  • 00:49:16 5 numbers to use.

  • 00:49:18 Available numbers.

  • 00:49:19 Numbers are 0, 1, 2, 3, 4.

  • 00:49:22 So, how do I represent?

  • 00:49:24 I represent it as 2 plus.

  • 00:49:28 Right?

  • 00:49:29 It would be 2.

  • 00:49:31 And it would be 0, 0.

  • 00:49:34 I mean 0, 0.

  • 00:49:36 Why?

  • 00:49:37 Because it would mean 0, 5, 5, 3 plus 5, 2 plus 2, 5, 1 plus 2, 5, 0.

  • 00:49:47 Which would mean 0 plus 0 plus.

  • 00:49:50 And you see, this is how we represent numbers in different phases.

  • 00:49:58 And everything in computer science, computers, represented as binary in the phase.

  • 00:50:05 That is how bits and bytes are composed.

  • 00:50:09 I am repeating again to watch.

  • 00:50:12 I'm repeating again to watch computer science playlist.

  • 00:50:17 It will help you tremendously.

  • 00:50:18 Believe me.

  • 00:50:20 So, please watch this video series entirely at least 2 times.

  • 00:50:26 It is better for you, better for me.

  • 00:50:30 Okay.

  • 00:50:31 So, for this course, I think this is enough.

  • 00:50:32 We will continue next week.

  • 00:50:34 So, this is same as start debugging at 5.

  • 00:50:38 Okay.

  • 00:50:39 Please watch this lesson 2 times.

  • 00:50:41 This is your most important course that you will take in software engineering.

  • 00:50:46 Believe me.

  • 00:50:47 You will build everything on top of this course, on top of introduction to programming.

  • 00:50:54 So, you have to learn this course perfectly to become a good software engineer.

  • 00:51:02 Okay.

  • 00:51:03 I'm uploading everything to our GitHub repository.

  • 00:51:06 So, you can download this at your home.

  • 00:51:09 I will show it to you right now in a moment.

  • 00:51:13 So, when I type, it says there is lectures.

  • 00:51:17 I'm adding it.

  • 00:51:18 This is git bash source code.

  • 00:51:20 Now, the files, the code we have written is uploaded to our GitHub repository.

  • 00:51:26 Let's open it.

  • 00:51:27 I'm going to open it.

  • 00:51:28 And you see introduction to programming updated 12 seconds ago.

  • 00:51:32 You see the lecture has arrived here.

  • 00:51:34 You can look from this window.

  • 00:51:36 When I click the program series, I will see the source code.

  • 00:51:39 You see like this.

  • 00:51:40 To download it, you can download entire project.

  • 00:51:44 Okay.

  • 00:51:45 Like this.

  • 00:51:46 Download as zip.

  • 00:51:47 Okay.

  • 00:51:48 It will download.

  • 00:51:50 You can open zip file as right click, extract.

  • 00:51:55 And inside that, you will see the lectures.

  • 00:51:57 Okay.

  • 00:51:59 And you can open from here.

  • 00:52:01 Alternatively, you can install git bash software and take this to copy the URL.

  • 00:52:07 Copy URL here.

  • 00:52:09 Open your git bash.

  • 00:52:10 When I type git bash, you see.

  • 00:52:13 And let's say I'm going to compose here a temp folder.

  • 00:52:17 Okay.

  • 00:52:18 Give me desktop.

  • 00:52:19 Give me temp.

  • 00:52:20 Git clone repository.

  • 00:52:21 And it will clone the entire repository into this.

  • 00:52:26 You will get the latest version of the...

  • 00:52:28 Okay.

  • 00:52:29 From here, you can see all the source code downloaded to my screen.

  • 00:52:33 All right.

  • 00:52:34 See you later, hopefully.

  • 00:52:36 Stay safe.

  • 00:52:37 Be aware of COVID-19.

Clone this wiki locally