Introduction to programming and C languages.

Introduction programming and programming language



Hello dear friends welcome to our site today I'm going to start a course on programming in c language,


 so I'm going to discuss some basic things what is need of programming, why do you write programs what is need of writing these programs what is need of programming languages and then we will come to c language right.


 so now let us discuss what is need of programming? why do you write programs see computer is what it's you can say a machine or you can say a general-purpose machine the use of computer is what which can be which can perform any task any computational task, not any task any computational task it can perform right but how do you communicate with computer like suppose if you want to add two numbers then it's not like that you will say hey computer I want to add two numbers four and five.


 so tell me what is the edition of four and five no computer will not understand your language so now what you will do we will write some instructions you can say the sequence of instructions and we will give those sequences or sets of instructions to computer and then according to that computer will perform your task right


 so those sets of instructions or what program sequence of instructions are what programs right that is why if you want that your computer will perform some the task for you have to write programs right that is why we need to write programs fine but now see the language of the computer is what binary language I hope everybody knows 0 and 1 


the computer can understand only 0 and 1 binary so if you write like if you write instructions in the English language in language or in any language, the computer will not understand then what we will do that also will discuss how that language how that program will be converted into zero and when and then the computer will perform your task fine so basically you can say what computer run by programs computer is nothing without programs it cannot do anything without programs when you purchase a new laptop or computer that has already you know many programs are already there in uh that program 


so you can sorry in your computers like some system programs application programs or you must have heard about system software's application software is what definitely, it is a set of programs right so system programs mean what they are going to manage that system resources they are going to manage the hardware and application programs or application software's are what they are basically used to perform your tasks your favorite task like um web browser in is application software and text editor in which 

 you can edit you can write the text you can edit text MS office that is also an application software right but suppose if you want the computer to perform your task any specific task according to that you have to write your own program and you have to submit that program you have to give that program to the computer and then the computer will understand your program or you can say those sequence of instructions and according to that will give you some output right so now how do you write programs like it's not like in simple English language you will write programs and submit to computer no it is not going to understand so for that thing


 we need programming languages right see when we communicate with each other like if I want to communicate with you then the language is maybe English Hindi right so and for communication what first of all you need to understand the alphabets first we uh study what abcd and then words then we frame sentences by using grammars and all right and then we communicate then we frame sentences and then we communicate with each other same thing in language also you need to learn something before before writing the programs like the characters character set of that language keywords and some syntaxes and some rules right and then we can write programs and then we can

 

 

language then definitely we are not going to write like 0 1 0 0 1 suppose I write this one this is a bunch of 0s and 1 but we are not able to understand what is meaning of this thing right but maybe computer can understand obviously computer will understand because it is the language of computer right so we write what hash include studio dot touch hash include corneo dot then word main then integer a b into a b then print scarf and everything so that program, first of all, has to be converted into this language machine language zero and one form and then the computer will execute your program or more specifically 


I would say CPU because it is what processor central processing unit this is processor this is you can say the heart of computer the calculation the computation the task which you are going you need to perform on a computer that is going to be performed by CPU more specifically if I will say then CPU will give you output right so if you write a program in this format this is what machine level language


 I hope you have heard about machine level languages assembly level languages then high-level languages or low level languages middle-level languages right but we will uh generally prefer to call high-level languages right high-level languages mean the c c plus java these are understandable by humans because if we write this if we see at this code then we are not going.


 we will not understand what is this so this is machine-level language right but before the invention of these high-level languages they used to write programs in this format see you can imagine how tough it was at that time to write a program in this language machine language 


because see and this is what this is according to you know that CPU architecture some set of specifications are there which some architecture is there which CPU follows uh I think you will you or maybe you have um studied the subject co a computer organization and architecture in that you must have studied those architectures right so according to that specification the arc architecture of the CPU this code will differ it means it is machine dependent in one computer the same a program like the addition of two numbers let us suppose uh in at one CPU right suppose according to the CPU architecture or the specifications the instruction can be given in 20 bits like 20 bits right and first four-bit are for the operator.


 I hope everybody knows like I suppose I am writing 1 plus 2 1 and 2 these are operands and plus is operator here we write as opcode suppose these first 4 bits are for this class to indicate this plus and suppose here plus ah I'll write like 0 0 1 0 0 0 1 0 so computer will understand that this is for plus that he has to perform plus operation right and then next eight bits are for one this operand and next eight bit are for the second operand we will write these two operands into binary form right like zero zero zero seven zeros and one and two how you will write this is two in binary form so that


 we will write here and when we submit this instruction then the CPU will perform addition on one on one and two and it will give you the result right and suppose the according to the specification of CPU to the second processor may be there plus is 0 0 0 1 right or maybe the length of the instruction is something else, not 20 bits so it's not easy to write programs in machine language because it is dependent on that machine to machine so it is not the programs are not portable in one machine if you are writing a program for edition then again you have to write a rewrite that program for the second machine it's not like that the same program 


will run on the second machine that is very difficult then assembly level languages come these levels will discuss ah in a separate video with more details and after that high-level languages come to overcome these limitations to add portability a concept so that one program on one machine we write and that program can easily be ported to second machine means 


we can uh we can run that program same program on the second machine also without any modification or maybe you can say with few modifications right so now let us discuss what is c language see it was developed by Dennis Ritchie in 1972 where bell laboratories the headquarter of this bell, labs are where in new jersey u's right and it is 


                




before c the language was developed by language so you can say c is what successor of b the language it was developed by uh ken Thompson right why c language was developed at that time basically, the main purpose was to you know write an operating system that is Unix operating system that was already written in b language but there was some limitations so to overcome those limitations because c was more powerful than b language right so they used to uh write the kernel of Unix operating system they used this language c language so c is basically you can say it's a system programming languages language many software's have been written in c language oracle android the core.

 



Post a Comment

0 Comments