INTRODUCTION TO C PROGRAMMING

Unformatted text preview:

INTRODUCTION TO C PROGRAMMING Introduction C Programming is a widely used programming language It was developed in the early 1970s by Dennis Ritchie at Bell Labs Types of Programming Languages Programming Language A programming language is a set of instructions written by a programmer to deliver instructions to the computer to perform or to accomplish a task It provides a structured way to write code that a computer can understand and execute Programming languages are fundamental in software development enabling developers to create applications control hardware and solve various computational problems Types of Programming Languages Machine Level Languages Assembly Languages High Level Languages Machine Level Language also known as Machine Code is the lowest level of programming language and consists of binary code 0s and 1s that is directly executed by a computer Machine code is expressed in binary 0s and 1s It is directly executed by the hardware without any need for translation Example 10110000 00000101 binary instructions Advantages Performance Offers the fastest execution because it is executed directly by the hardware Disadvantages Complexity Writing and debugging machine code is extremely complex and error prone due to its low level nature Assembly Language is a type of low level programming language that is closely related to a computer s machine code It uses symbolic names OR alphanumeric codes mnemonics for instructions and operands making it more easy for human when compared to raw binary machine code Example the mnemonic MOV stands for move and is used to move data from one location to another Assembly language statements are entered one statement per line Syntax label mnemonic operands comment The fields in the square brackets are optional A basic instruction has two parts The first one is the name of the instruction or the mnemonic which is to be executed The second are the operands or the parameters of the command Example start Label marking the start of the program MOV TOTAL 48 Transfer the value 48 in the memory variable TOTAL ADD AX 3 Add 3 to the value in AX Label Marks locations in the code Mnemonic Represents the operation to be performed Operands Specify the data or addresses involved in the operation Comment Provides explanatory notes for clarity and documentation Advantages One of the main advantages of assembly language is that it can produce very fast and efficient code Because assembly language is close to the machine code Disadvantages It is very complex and difficult to understand The syntax is difficult to remember Assembler translator It is human readable code but not executable by the CPU An assembler is a type of translator used to convert assembly language programs into machine code which is executable by a computer s CPU High Level Languages are programming languages designed to be easy for humans to read and write High level languages are easier to understand for humans because they use a lot of symbols letters phrases to represent logic and instructions in a program They provide a more user friendly approach compared to assembly language by simplifying the interaction between code and hardware This ease of use allows developers to concentrate on writing logic and functionality without having to manage the complex details of hardware operations Advantages The biggest advantage of using high level languages is that they are easy to understand remember learn write codes to debug Different libraries available reduce the amount we need to write It hides the complexities of hardware from the programmer Portable different platforms without much modification in code Disadvantages High level languages are slower as compared to low level languages because require more processing and more memory for execution High level languages have less control over hardware Translator High level languages are translated into machine code using a variety of tools primarily compilers and interpreters These tools are essential for converting the high level instructions written by developers into executable code that a computer s CPU can run System software Software is a set of instructions data or programs that computers use to operate and perform tasks System software is a type of computer software designed to provide a platform for running application software and to manage hardware components It serves as a mediator between the hardware of a computer and the user applications ensuring that both interact smoothly Example OS Compiler Editors Application software refers to programs designed to perform specific tasks or solve particular problems for users Example Microsoft Word railway reservation Weather forecasting Operating System OS is a system software that helps users to operate a computer efficiently The primary purpose is to act as Interface between hardware computer and User 3 Main responsibilities of OS namely To provide Interface between hardware and User Manage the Resources of the computer Provide support for storing and executing other software In general OS is reasonable for over all in charge of whole computer User can copy print type listen etc but in early days DOS Provided Through various commands Nowadays OS facilities through graphical interface using icons etc GUI Graphical user interface it helps users in easier and interactive operation of computer OS in market classify into 3 categories DOS Windows OS GUI Based OS Unix Linux OS Refer book Schaum s Outlines Programming with C by Byron Gottfried for detail explanationCompiler To communication with computer we need set of instructions Instructions usually English statements known as High level languages Computer can understand only Machine code A compiler is a kind of system software that translates programs written in any high level language to machine code Original HLL Source code Resulting machine language program object program C Compiler Pascal compiler Java Compiler different language compiler Interpreter Interpreter is a software similar to compiler It is System Software Convert HLL to machine but different Compiler convert whole program to machine code But interpreter Store in memory and execute one line to machine code then next Interpreter is smaller and simpler than compiler but take more time LISP List processing language AI application Interpreter General purpose languages C Pascal Fortan BASIC Special purpose languages designed for particular SIMAN CSMPLinker In C programming a


View Full Document

INTRODUCTION TO C PROGRAMMING

Download INTRODUCTION TO C PROGRAMMING
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view INTRODUCTION TO C PROGRAMMING and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view INTRODUCTION TO C PROGRAMMING and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?