0% found this document useful (0 votes)
12 views28 pages

1 - Introduction To Programming

The document provides an introduction to programming languages and paradigms, focusing on imperative and declarative programming. It discusses various programming paradigms, including procedural, object-oriented, and functional programming, along with their advantages and disadvantages. Additionally, it covers the basics of integrated development environments and common functions used in programming languages like C.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views28 pages

1 - Introduction To Programming

The document provides an introduction to programming languages and paradigms, focusing on imperative and declarative programming. It discusses various programming paradigms, including procedural, object-oriented, and functional programming, along with their advantages and disadvantages. Additionally, it covers the basics of integrated development environments and common functions used in programming languages like C.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Introduction to

Programming
MIDTERM CHAPTER 1
Objectives of the lesson

At the end of the unit, the students must have:

discussed the different • used integrated • used the basic input


programming development and output syntax.
language concepts environment;
and overview of
• explained the basic
programming
parts of a program;
paradigms;
and
Programming
Languages and
Paradigms
What is a paradigm?
• Paradigm can also be termed as method to solve some problem or do
some task. Programming paradigm is an approach to solve problem
using some programming language or also we can say it is a method
to solve a problem using tools and techniques that are available to us
following some approach. There are lots for programming language
that are known but all of them need to follow some strategy when they
are implemented and this methodology/strategy is paradigms. Apart
from varieties of programming language there are lots of paradigms to
fulfill each and every demand.

https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
What is a paradigm?

https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
imperative
imperative
• Imperative programming paradigm:
It is one of the oldest programming paradigm. It features
close relation to machine architecture. It is based on Von
Neumann architecture. It works by changing the program
state through assignment statements. It performs step by
step task by changing state.
• The main focus is on how to achieve the goal. The
paradigm consist of several statements and after execution
of all the result is stored.
https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
imperative
• Examples of Imperative programming paradigm:
• C : developed by Dennis Ritchie and Ken Thompson
• Fortran : developed by John Backus for IBM
• Basic : developed by John G Kemeny and Thomas E
Kurtz

https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
imperative
• Advantage:
1.Very simple to implement
2.It contains loops, variables etc.

• Disadvantage:
1.Complex problem cannot be solved
2.Less efficient and less productive
3.Parallel programming is not possible

https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
imperative

https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
imperative
• Imperative programming is divided into three broad categories: Procedural, OOP and
parallel processing.

• Procedural programming paradigm – The procedural programming paradigm is where


program code is divided up into procedures, which are discrete blocks of code that carry
out a single task.

• Examples of Procedural programming paradigm:


• C : developed by Dennis Ritchie and Ken Thompson
• C++ : developed by Bjarne Stroustrup
• Java : developed by James Gosling at Sun Microsystems
• ColdFusion : developed by J J Allaire
• Pascal : developed by Niklaus Wirth

https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
imperative
• Object oriented programming – The program is written as a collection
of classes and object which are meant for communication. The smallest
and basic entity is object and all kind of computation is performed on
the objects only. More emphasis is on data rather procedure. It can
handle almost all kind of real life problems which are today in scenario.

Advantages:
•Data security
•Inheritance
•Code reusability
•Flexible and abstraction is also present
https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
imperative
• Examples of Object Oriented programming paradigm:

• Simula : first OOP language


• Java : developed by James Gosling at Sun Microsystems
• C++ : developed by Bjarne Stroustrup
• Objective-C : designed by Brad Cox
• Visual Basic .NET : developed by Microsoft
• Python : developed by Guido van Rossum
• Ruby : developed by Yukihiro Matsumoto
• Smalltalk : developed by Alan Kay, Dan Ingalls, Adele Goldberg

https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
OOP EXAMPLE

https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
Parallel processing
• Parallel processing approach
• Parallel processing is the processing of program instructions by
dividing them among multiple processors.
• A parallel processing system posses many numbers of processor
with the objective of running a program in less time by dividing them.
This approach seems to be like divide and conquer.
• Examples are NESL (one of the oldest one) and C/C++ also supports
because of some library function.

https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
declarative
Declarative programming
• Declarative programming paradigm:
• Declarative programming is a programming paradigm in which
the programmer defines what needs to be accomplished by the
program without defining how it needs to be implemented. In
other words, the approach focuses on what needs to be
achieved instead of instructing how to achieve it.
• The declarative programming approach helps in simplifying the
programming behind some parallel processing applications.
• Prolog, SQL and embedded SQL are some of the well-known
examples of declarative programming languages.

https://www.techopedia.com/definition/18763/declarative-programming
Declarative programming
• Logic programming paradigms
• It can be termed as abstract model of computation. It would solve
logical problems like puzzles, series etc. In logic programming we
have a knowledge base which we know before and along with the
question and knowledge base which is given to machine, it
produces result.
• In logical programming the main emphasize is on knowledge base
and the problem. The execution of the program is very much like
proof of mathematical statement, e.g., Prolog

https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
Declarative programming
• Functional programming paradigms –
The functional programming paradigms has its roots in mathematics
and it is language independent.
• The key principle of this paradigms is the execution of series of
mathematical functions.
• Examples of Functional programming paradigm:
• JavaScript : developed by Brendan Eich
• Haskell : developed by Lennart Augustsson, Dave Barton
• Scala : developed by Martin Odersky
• Erlang : developed by Joe Armstrong, Robert Virding
• Lisp : developed by John Mccarthy
• ML : developed by Robin Milner
• Clojure : developed by Rich Hickey
https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
Declarative programming
• Database/Data driven programming approach –
• This programming methodology is based on data and its movement.
• Program statements are defined by data rather than hard-coding a
series of steps.
• A database program is the heart of a business information system
and provides file creation, data entry, update, query and reporting
functions.
• There are several programming languages that are developed mostly
for database application. For example SQL, MySql etc.

https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
Declarative programming

https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
Integrative
development
environment
dEFINITION A main is a predefined
keyword or function in C. It
02 is the first function of every
01 03
C program that is
<stdio.h> is header file for
The conio.h header file used in C responsible for starting
Standard Input Output,
programming language contains the execution and
“<stdlib.h>” is header file for
functions for console input/output. termination of the
Standard Library.
program.

06 getch is used to get a


04 The printf() is a library 05 character as input from
function to send scanf() is one of the the user.
formatted output to the commonly used function
screen. to take input from the
user. clrscr(); This function is
07 used to clear the previous
output from the console.
rEFERENCES
https://www.programmingsimplified.com/c/conio.h
https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
https://intellipaat.com/blog/tutorial/c-tutorial/hello-program-c/
It's so lovely
to meet all
of you!
Thank you for listening.

You might also like