computer programming languagemachine language is the lowest level of programming language machine...

34
Computer Programming Language Dr. M. N. Quadri Assistant Professor & Head Department of Computer Science Nilkantrao Shinde Science & Arts College Bhadrawati, Dist. Chandrapur Maharashtra

Upload: others

Post on 27-Jul-2020

33 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

Computer Programming Language

Dr. M. N. QuadriAssistant Professor & Head

Department of Computer Science

Nilkantrao Shinde Science & Arts College

Bhadrawati, Dist. Chandrapur Maharashtra

Page 2: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

2

I would like to thanks the following

1. UGC-HRDC, University of Hyderabad, Hyderabad

2. E Balagurusamy, “Programming in ANSI C”, Tata

McGraw-Hill Edition 2.1

3. Yeshwant Kanetkar, “Let Us C”, BPB Publication, 8th

Edition.

4. www.google.com

5. www.wikepedia.com

ACKNOWLEDGEMENT

Page 3: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

3

Steps is Language

Alphabets Words Sentences Paragraphs

English Language

C Language

Alphabets

Digits

Special

symbols

Constants

Variables

Keyword

Instructions Program

Page 4: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

Programming Language

Low Level LanguageHigh Level Language

Machine Language Assembly Language

Page 5: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

Language Translator

1. Assembler : Convert AL-ML and vice versa

Ex. Assembly Language

2. Interpreter : Line by Line convert HLL-ML and vice versa

Ex. BASIC Language

3. Compiler : Compile all programs at once. Convert HLL-

ML and vice versa

Ex. C, C++ Languages

Page 6: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

Computer Languages

Page 7: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

Machine Language

It is first type of programming language to be developed.

A language that is directly interpreted into the hardware

Machine language is the lowest level of programming language

Machine language which computer understand and it is usually written in hex.

A manufacturer designs a computer code, which is represented inside the

computer by a string of binary digits (bits) 0 and 1.

The symbol 0 - absence of an electric pulse 1- presence of an electric pulse.

Since a computer is capable of recognizing electric signals, it understands

machine language.

Page 8: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

Machine Language

Why Use ?

Machine language makes fast and efficient use of the computer.

It requires no translator to translate the code.

It is directly understood by the computer.

Why Not ?

All operation codes have to be remembered

All memory addresses have to be remembered.

It is hard to amend or find errors in a program written in the machine

language.

Page 9: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

Assembly Language

Assembly language was developed to overcome some of the many

inconveniences of machine language.

This is another low-level but very important language in which operation

codes and operands are given in the form of alphanumeric symbols instead

of 0‟s and l‟s.

These alphanumeric symbols are known as mnemonic codes and can

combine in a maximum of five-letter combinations e.g. ADD for addition,

SUB for subtraction, START, LABEL etc.

Because of this feature, assembly language is also known as „Symbolic

Programming Language.„

Page 10: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

Assembly Language

This language is also very difficult and needs a lot of practice to master it

because there is only a little English support in this language.

Mostly assembly language is used to help in compiler orientations.

The instructions of the assembly language are converted to machine codes

by a language translator and then they are executed by the computer.

Page 11: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

Assembly Language

Why Use ?

Assembly language is easier to understand and use as compared to

machine language.

It is easy to locate and correct errors.

It is easily modified.

Why Not ?

Like machine language, it is also machine dependent/specific.

Since it is machine dependent, the programmer also needs to understand

the hardware.

Page 12: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

High Level Language

High-level computer languages use formats that are similar to English.

The purpose of developing high-level languages was to enable people to

write programs easily, in their own native language environment (English).

High-level languages are basically symbolic languages that use English

words and/or mathematical symbols rather than mnemonic codes.

Each instruction in the high-level language is translated into many machine

language instructions that the computer can understand.

Page 13: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

High Level Language

Why Use?

High-level languages are user-friendly

They are similar to English and use English vocabulary and well-known

symbols

They are easier to learn

They are easier to maintain

They are problem-oriented rather than 'machine'-based

A program written in a high-level language can be translated into many

machine languages and can run on any computer for which there exists an

appropriate translator

The language is independent of the machine on which it is used i.e.

programs developed in a high-level language can be run on any computer

text

Page 14: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

High Level Language

Why Not?

A high-level language has to be translated into the machine language by a

translator, which takes up time

The object code generated by a translator might be inefficient compared to

an equivalent assembly language program

Page 15: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

Types of High-Level Languages

1) Algebraic Formula-Type Processing

2) Business Data Processing

3) String and List Processing

4) Procedure Oriented Programming

5) Object-Oriented Programming Language

6) Visual Programming Language

Page 16: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

These languages are oriented towards the computational

procedures for solving mathematical and statistical problems.

Examples

BASIC (Beginners All Purpose Symbolic Instruction Code)

FORTRAN (Formula Translation)

PL/I (Programming Language, Version 1)

ALGOL (Algorithmic Language)

APL (A Programming Language)

1) Algebraic Formula-Type Processing

Page 17: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

These languages are best able to maintain data processing

procedures and problems involved in handling files. Some

Examples

COBOL (Common Business Oriented Language)

RPG (Report Program Generator)

2) Business Data Processing

Page 18: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

These are used for string manipulation, including search

patterns and inserting and deleting characters.

Examples

LISP (List Processing)

Prolog (Program in Logic)

3) String and List Processing

Page 19: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

These are used for maintaining the procedure in which the

execute the statement sequence or top to bottom

Example : C

4) Procedure Oriented Language

Page 20: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

In OOP, the computer program is divided into objects.

Examples :

C++

Java

6) Object-Oriented Programming Language

Page 21: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

These programming languages are designed for building

Windows-based applications.

Examples :

Visual Basic

Visual Java

Visual C

7) Visual Programming Language

Page 22: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

C Language

■Case Sensitive.

■Reusability

■Readability

■Maintainability

■Portability

■Learn ability

■Major parts of popular operating systems like

Windows, UNIX, Linux is still written in C.

Page 23: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

Dennis Ritchie

Inventor of C

Bjarne Stroustrup

Inventor of C++

James Gosling

Inventor of Java

Inventor of Programming Languages

Page 24: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

24

Steps is Language

Alphabets Words Sentences Paragraphs

English Language

C Language

Alphabets

Digits

Special

symbols

Constants

Variables

Keyword

Instructions Program

Page 25: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

Structure of C Program

1. Documentation Section

2. Link Section

3. Definition Section

4. Global Declaration Section

5. Main Function Section

6. Subprogram Section

Page 26: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

1. Documentation Section

Comment

/* and */

Any where in the program

/* Program for Addition of Two Numbers */

Page 27: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

2. Link Section

Provide instructions to Compiler

Compiler link functions from the system library

Include Directory

Header files (Ex. stdio.h conio.h string.h)

#include<stdio.h>

Page 28: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

3. Definition Section

Define Symbolic Constant (Ex. )

define keyword

New word is define

#define PI 3.14

Page 29: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

4. Global Declaration Section

Variable access by all functions

Access by main and subprogram

It is out side of all the function

int x=10;

Page 30: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

5. Main Function Section

Compulsory Section

Contains main() function

Two parts (Declaration and Executable)

small case statements

Each line end with semicolon (;)

All statements within { }

Page 31: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

5. Main Function Section

main()

{

int a,b,c;

printf(“Enter two numbers”);

scanf(“%d%d”,&a,&b);

c=a+b;

printf(“\n Addition= %d”, c);

}

Declaration

Executabl

e

Page 32: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

6. Subprogram Section

Contains user defined functions

The main function call these functions

It can call main function also

srtmu() ymn()

Page 33: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

6. Subprogram Section

main()

{

int a,b;

printf(“Enter two numbers”);

scanf(“%d%d”,&a,&b);

srtmu(a,b);

}

srtmu( int x, int y)

{

int z;

z=x+y;

printf(“\n Addition= %d”, z);

}

Subprogram

Page 34: Computer Programming LanguageMachine language is the lowest level of programming language Machine language which computer understand and it is usually written in hex. A manufacturer

34

Contact:

Email: [email protected]

Cell : 09860178791