Hello everyone from today we'll start with C programming. So when you talk about C programming, C is the programming language is there from last 44 years and it was created by a person called Dennis Ritchie. So this guy here and so if you see the Wikipedia page for C programming it says it is designed by Dennis Ritchie.
It's a imperative type of programming also called as procedural so it follows pop. Again we'll discuss later what is POP. It was first appeared in 1972, 44 years ago and it supports multiple platforms so you can run the same code in Macintosh, you can run in Windows, you can run in Linux, right?
And it was influenced by a language called as B. Now lots of people say there's no logic of having a language named called as C, it was just he thought of putting it at C but the fun part is it has Since it is influenced by B language, that's why the language name is C. And after C, we have lots of languages which is derived from C language. Example C++, then C Sharp, Objective C, Java. So all these languages are based on C language.
And that's why C is called as mother of all the languages. It's not that C is the first language, it's because C is the first complete language. So you're moving your step towards one of the best languages ever and that is C. So let's start with the programming itself. So when we talk about the C programming, you have to follow some syntax because C is statically typed language which we have to maintain a proper syntax.
Now what we'll do is we'll write a code just to print something. When you start with any programming language, maybe this is your first time you're learning a new language. So in your future you'll be learning lots of languages maybe C, C++, C sharp, Java, Python. In all these languages whenever you start with the first code it should be of hello world.
Now it's not compulsory that you should use hello world it's just you know whenever you start any good work you go for the inauguration. So imagine hello world as the inauguration of programming languages. So what we'll do is we'll try to print hello world.
Now whenever you say you want to print something so when you say you want to print so you want to print on console. Now what is console? The output window is your console.
This thing here is called as editor. Now you can use lots of editors or IDEs. I am using here Xcode.
So Xcode is a development tool for Macintosh. If you are a Windows user, you can use Turbo C++. You can also use Dave C++. There are lots of IDEs for C for Windows.
If you are using Linux, you can use GCC compiler. So there are lots of IDEs available. So I will just suggest go to Google and search for different IDEs for C. Now what we'll do is we'll just print hello world here.
So whenever you want to print something, you want to print in the exact format, you have to use something called as double quotes. Now double quotes is used to print string. So what is string? It's a combination of characters.
So if you have a combination of characters, it is called as string. So you have to use something called as double quotes. Now C as we know C is basically procedural oriented programming right which is POP.
So as we have seen in the Wikipedia page it is it follows procedures. Now what is POP? POP is something let's say you want to do some task in C.
So everything is a procedure. So you want to achieve addition of two numbers. It's a procedure.
If you want to log into a system that is a procedure. If you want to withdraw amount from your Bank that is a procedure and this procedure in C is called as functions So whenever you want to achieve anything in C you have to create functions Okay, so to print something we need to use a function and that function is called as printf and whenever you use functions we have to give a round brackets and After a statement or after the line you have to give a semicolon which defines the end of the statement, okay? So once again you want to print hello world here and hello world is a string which is a combination of characters.
So we have to use double quotes and since you want to do a task we need to use functions. So functions are basically used to do a task. And to print something we have a inbuilt function which is printf. So function can be of two types.
It can be inbuilt function from C or you can define your own functions. So how to define your own function that we'll see later. Time when we will focus on inbuilt functions which is printf. Now when you say you want to print something so we have printf right. But whenever you want to execute your code, your code will need a starting point.
And that starting point in C is called as main. So we have to define a main function. So main is a function here.
Okay, since you are defining that function, you have to provide open braces and curly braces. So what this main will do will be defined by this curly brackets. So anything you define in this curly brackets, it will execute those tasks. So you cannot write a C code or you cannot execute a C code without main.
Because main is the first thing your CPU will execute for the C programming. Okay. So we have to say main printf.
Now the second problem. We are using printf, right? And printf is an inbuilt function. So whenever you say you have something inbuilt. So where is it?
Is it in the air? Or is it in your RAM or somewhere? So every method or every function in C will have a proper definition.
So that definition is... Included in a file called as stdio so it has a file and dot H is the extension Okay, so once again whenever you want to use printf which is a function we need a definition for that function So this definition will be available in this file Which is called as stdio which is standard input output dot H Now this H means header file Okay, this H will be called as header file. Now what is header file?
It's a file in which you'll be having all the definitions of functions. So printf is not the only function, right? There might be other functions. So all these functions will be defined in any header file.
It may be std.h, it may be abc.h, it may be star, star, star.h. It can be any file, right? Now if anybody want to use or if anybody want to include a header file in your code we need to use something called as include so we use a keyword called as include to use this header file in your code and when you want to use header file we need to give this angular brackets so angular bracket open and close and so that we have to use include and we have to mention the header file here now since we need to we need to we need to use this statement before printf while execution we need to use something called as hash.
Now hash is also called as pre-processor. So anything which is defined using hash is called as pre-processor. So that means before executing printf, it will first include all the files which is used with hash.
Simple right? And once you complete this code, now you have to run. Now how to run this in Turbo C++?
So you can see there will be a sign called as run in the menu. So if you click on run it will execute your code in Turbo C++ Same time using Xcode here We will be simply using a shortcut You can also use, there is an option called as product You can click on run Or you can use a shortcut called as command R So I will be using that command here So it is command R And you can see it says build succeed And that's your output which is hello world Ignore this line which is given by your Xcode window so our focus is this one which is hello world so that's how you print your first statement in c programming but there's a problem here it says type specifier missing so default to end now what's that so we'll solve this error in the next video so so thank you so much for watching and make sure you subscribe this channel so that you can watch the further tutorials