18 css101j pps unit 1
Evolution of Programming & Languages - Problem Solving through Programming - Creating Algorithms - Drawing Flowcharts - Writing Pseudocode - Evolution of C language, its usage history - Input and output functions: Printf and scanf - Variables and identifiers – Expressions - Single line and multiline comments - Constants, Keywords - Values, Names, Scope, Binding, Storage Classes - Numeric Data types: integer - floating point - Non-Numeric Data types: char and string - Increment and decrement operator - Comma, Arrow and Assignment operator - Bitwise and Sizeof operator
This slide notes are more than 10 years old of my teacher Mr Karim Zebari. He uses a brilliant simple language to explain programming principles step by step.
In this PPT you will learn how to use looping in python.
For more presentation in any subject please contact us on
raginijain0208@gmail.com.
You get a new presentation every Sunday at 10 AM.
Learn more about Python by clicking on given below link
Python Introduction- https://www.slideshare.net/RaginiJain21/final-presentation-on-python
Basic concept of Python -https://www.slideshare.net/RaginiJain21/python-second-ppt
Python Datatypes - https://www.slideshare.net/RaginiJain21/data-types-in-python-248466302
Python Library & Module - https://www.slideshare.net/RaginiJain21/python-libraries-and-modules
Basic Python Programs- https://www.slideshare.net/RaginiJain21/basic-python-programs
Python Media Libarary - https://www.slideshare.net/RaginiJain21/python-media-library
This presentation deals with pure object oriented concepts and defines basic principles of OOP's like Encapsulation , polymorphism , Inheritance and Abstraction.
This slide notes are more than 10 years old of my teacher Mr Karim Zebari. He uses a brilliant simple language to explain programming principles step by step.
In this PPT you will learn how to use looping in python.
For more presentation in any subject please contact us on
raginijain0208@gmail.com.
You get a new presentation every Sunday at 10 AM.
Learn more about Python by clicking on given below link
Python Introduction- https://www.slideshare.net/RaginiJain21/final-presentation-on-python
Basic concept of Python -https://www.slideshare.net/RaginiJain21/python-second-ppt
Python Datatypes - https://www.slideshare.net/RaginiJain21/data-types-in-python-248466302
Python Library & Module - https://www.slideshare.net/RaginiJain21/python-libraries-and-modules
Basic Python Programs- https://www.slideshare.net/RaginiJain21/basic-python-programs
Python Media Libarary - https://www.slideshare.net/RaginiJain21/python-media-library
This presentation deals with pure object oriented concepts and defines basic principles of OOP's like Encapsulation , polymorphism , Inheritance and Abstraction.
A class is a code template for creating objects. Objects have member variables and have behaviour associated with them. In python a class is created by the keyword class.
An object is created using the constructor of the class. This object will then be called the instance of the class.
Machine learning with Big Data power point presentationDavid Raj Kanthi
This is an article made form the articles of IEEE published in the year 2017
The following presentation has the slides for the Title called the
Machine Learning with Big data. that following presentation which has the challenges and approaches of machine learning with big data.
The integration of the Big Data with Machine Learning has so many challenges that Big data has and what is the approach made by the machine learning mechanism for those challenges.
What is an Array?
Array are the homogeneous(similar) collection of data types.
Array Size remains same once created.
Simple Declaration format for creating an array
type [ ] identifier = new type [integral value];
This presentation is all about various built in
datastructures which we have in python.
List
Dictionary
Tuple
Set
and various methods present in each data structure
This PPT is for First year engineering student,It covered all about C Programming according to Rajastha Technical University Kota.
flowchart, pseudo code, Programming Languages and Language Translators, Identifiers, Constants, Variables, Basic Data Types, Operators, Expressions, type casting, Input / Output Statement, Scope Rules and Storage classes, Preprocessor and Macro Substitution.
Everything about OOPs (Object-oriented programming) in this slide we cover the all details about object-oriented programming using C++. we also discussed why C++ is called a subset of C.
A string is a data type used in programming, such as an integer and floating point unit, but is used to represent text rather than numbers. It is comprised of a set of characters that can also contain spaces and numbers. For example, the word "hamburger" and the phrase "I ate 3 hamburgers" are both strings.
A class is a code template for creating objects. Objects have member variables and have behaviour associated with them. In python a class is created by the keyword class.
An object is created using the constructor of the class. This object will then be called the instance of the class.
Machine learning with Big Data power point presentationDavid Raj Kanthi
This is an article made form the articles of IEEE published in the year 2017
The following presentation has the slides for the Title called the
Machine Learning with Big data. that following presentation which has the challenges and approaches of machine learning with big data.
The integration of the Big Data with Machine Learning has so many challenges that Big data has and what is the approach made by the machine learning mechanism for those challenges.
What is an Array?
Array are the homogeneous(similar) collection of data types.
Array Size remains same once created.
Simple Declaration format for creating an array
type [ ] identifier = new type [integral value];
This presentation is all about various built in
datastructures which we have in python.
List
Dictionary
Tuple
Set
and various methods present in each data structure
This PPT is for First year engineering student,It covered all about C Programming according to Rajastha Technical University Kota.
flowchart, pseudo code, Programming Languages and Language Translators, Identifiers, Constants, Variables, Basic Data Types, Operators, Expressions, type casting, Input / Output Statement, Scope Rules and Storage classes, Preprocessor and Macro Substitution.
Everything about OOPs (Object-oriented programming) in this slide we cover the all details about object-oriented programming using C++. we also discussed why C++ is called a subset of C.
A string is a data type used in programming, such as an integer and floating point unit, but is used to represent text rather than numbers. It is comprised of a set of characters that can also contain spaces and numbers. For example, the word "hamburger" and the phrase "I ate 3 hamburgers" are both strings.
Oplægget blev holdt ved et seminar i InfinIT-interessegruppen Højniveausprog til Indlejrede Systemer den 2. oktober 2013. Læs mere om interessegruppen her: http://infinit.dk/dk/interessegrupper/hoejniveau_sprog_til_indlejrede_systemer/hoejniveau_sprog_til_indlejrede_systemer.htm
Guide to programming using object oriented languages such as java, python, c, c++ among other programming languages that focus on tying data closely to the function that operates on it rather than procedural oriented programming.
MODULE III Parallel Processors and Memory Organization 15 Hours
Parallel Processors: Introduction to parallel processors, Concurrent access to memory and cache
coherency. Introduction to multicore architecture. Memory system design: semiconductor memory
technologies, memory organization. Memory interleaving, concept of hierarchical memory
organization, cache memory, cache size vs. block size, mapping functions, replacement
algorithms, write policies.
Case Study: Instruction sets of some common CPUs - Design of a simple hypothetical CPU- A
sequential Y86-64 design-Sun Ultra SPARC II pipeline structure
MODULE II Control unit, I/O systems and Pipelining 15 Hours
CPU control unit design: Hardwired and micro-programmed design approaches, Peripheral
devices and their characteristics: Input-output subsystems, I/O device interface, I/O transfersprogram controlled, interrupt driven and DMA, privileged and non-privileged instructions, software
interrupts and exceptions. Programs and processes-role of interrupts in process state transitions,
I/O device interfaces - SCII, USB. Basic concepts of pipelining, throughput and speedup, pipeline
hazards.
Functional Blocks of a Computer: Functional blocks and its operations. Instruction set architecture of a CPU - registers, instruction execution cycle, Data path, RTL interpretation of
instructions, instruction set. Performance metrics. Addressing modes. Data Representation:
Signed number representation, fixed and floating point representations, character representation.
Computer arithmetic - integer addition and subtraction, ripple carry adder, carry look-ahead
adder, etc. multiplication - shift-and add, Booth multiplier, carry save multiplier, etc. Division
restoring and non-restoring techniques, floating point arithmetic.
Module II - Distributed objects and file systems:
Introduction - Communication between distributed objects - Remote procedure call - Events and notifications - case study - Operating system support - introduction - operating system layer - protection - process and threads - communication and invocation - architecture - Introduction to DFS - File service architecture - Sun network file system - Andrew file system - Enhancements and future developments.
Module 2 - Distributed Objects and File Systems
Introduction - Communication between distributed objects - Remote procedure call - Events and notifications - case study - Operating system support - introduction - operating system layer - protection - process and threads - communication and invocation - architecture - Introduction to DFS - File service architecture - Sun network file system - Andrew file system - Enhancements and future developments.
Module I
Introduction to Distributed systems - Examples of distributed systems, resource sharing and the web, challenges - System model - introduction - architectural models - fundamental models - Introduction to inter-process communications - API for Internet protocol - external data.
Module I
Introduction to Distributed systems - Examples of distributed systems, resource sharing and the web, challenges - System model - introduction - architectural models - fundamental models - Introduction to inter-process communications - API for Internet protocol - external data.
Module 6: IP and System Security
IP security overview-IP security policy-Encapsulating Security payload-intruders-intrusion detectionvirus/worms-countermeasure-need for firewalls-firewall characteristics-types of fire
Module 4: Key Management and User Authentication
X.509 certificates- Public Key infrastructure-remote user authentication principles-remote user
authentication using symmetric and asymmetric encryption-Kerberos V5
Module 1: Introduction to Cryptography and Symmetric Key Ciphers
Computer Security Concepts - OSI Security Architecture -Security Attacks - Services, Mechanisms -
Symmetric Cipher Model - Traditional Block Cipher Structure - The Data Encryption Standard -The Strength of DES - Advanced Encryption Standard.
Module 6
Advanced Networking
Security problems with internet architecture, Introduction to Software defined networking, Working of SDN, SDN in data centre, SDN applications, Data centre networking, IoT.
Module 6: Standards for Information Security Management
Information Security Management Systems (ISMS) - ISO 27001 - Framing Security Policy of
Organization- Committees- Security Forum, Core Committee, Custodian and Users, Business
Continuity Process Team & Procedure- Information Security Auditing Process. IT Security Incidents
Hierarchical Digital Twin of a Naval Power SystemKerry Sado
A hierarchical digital twin of a Naval DC power system has been developed and experimentally verified. Similar to other state-of-the-art digital twins, this technology creates a digital replica of the physical system executed in real-time or faster, which can modify hardware controls. However, its advantage stems from distributing computational efforts by utilizing a hierarchical structure composed of lower-level digital twin blocks and a higher-level system digital twin. Each digital twin block is associated with a physical subsystem of the hardware and communicates with a singular system digital twin, which creates a system-level response. By extracting information from each level of the hierarchy, power system controls of the hardware were reconfigured autonomously. This hierarchical digital twin development offers several advantages over other digital twins, particularly in the field of naval power systems. The hierarchical structure allows for greater computational efficiency and scalability while the ability to autonomously reconfigure hardware controls offers increased flexibility and responsiveness. The hierarchical decomposition and models utilized were well aligned with the physical twin, as indicated by the maximum deviations between the developed digital twin hierarchy and the hardware.
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
Welcome to WIPAC Monthly the magazine brought to you by the LinkedIn Group Water Industry Process Automation & Control.
In this month's edition, along with this month's industry news to celebrate the 13 years since the group was created we have articles including
A case study of the used of Advanced Process Control at the Wastewater Treatment works at Lleida in Spain
A look back on an article on smart wastewater networks in order to see how the industry has measured up in the interim around the adoption of Digital Transformation in the Water Industry.
Forklift Classes Overview by Intella PartsIntella Parts
Discover the different forklift classes and their specific applications. Learn how to choose the right forklift for your needs to ensure safety, efficiency, and compliance in your operations.
For more technical information, visit our website https://intellaparts.com
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERSveerababupersonal22
It consists of cw radar and fmcw radar ,range measurement,if amplifier and fmcw altimeterThe CW radar operates using continuous wave transmission, while the FMCW radar employs frequency-modulated continuous wave technology. Range measurement is a crucial aspect of radar systems, providing information about the distance to a target. The IF amplifier plays a key role in signal processing, amplifying intermediate frequency signals for further analysis. The FMCW altimeter utilizes frequency-modulated continuous wave technology to accurately measure altitude above a reference point.
6th International Conference on Machine Learning & Applications (CMLA 2024)ClaraZara1
6th International Conference on Machine Learning & Applications (CMLA 2024) will provide an excellent international forum for sharing knowledge and results in theory, methodology and applications of on Machine Learning & Applications.
Understanding Inductive Bias in Machine LearningSUTEJAS
This presentation explores the concept of inductive bias in machine learning. It explains how algorithms come with built-in assumptions and preferences that guide the learning process. You'll learn about the different types of inductive bias and how they can impact the performance and generalizability of machine learning models.
The presentation also covers the positive and negative aspects of inductive bias, along with strategies for mitigating potential drawbacks. We'll explore examples of how bias manifests in algorithms like neural networks and decision trees.
By understanding inductive bias, you can gain valuable insights into how machine learning models work and make informed decisions when building and deploying them.
Student information management system project report ii.pdfKamal Acharya
Our project explains about the student management. This project mainly explains the various actions related to student details. This project shows some ease in adding, editing and deleting the student details. It also provides a less time consuming process for viewing, adding, editing and deleting the marks of the students.
Saudi Arabia stands as a titan in the global energy landscape, renowned for its abundant oil and gas resources. It's the largest exporter of petroleum and holds some of the world's most significant reserves. Let's delve into the top 10 oil and gas projects shaping Saudi Arabia's energy future in 2024.
The Internet of Things (IoT) is a revolutionary concept that connects everyday objects and devices to the internet, enabling them to communicate, collect, and exchange data. Imagine a world where your refrigerator notifies you when you’re running low on groceries, or streetlights adjust their brightness based on traffic patterns – that’s the power of IoT. In essence, IoT transforms ordinary objects into smart, interconnected devices, creating a network of endless possibilities.
Here is a blog on the role of electrical and electronics engineers in IOT. Let's dig in!!!!
For more such content visit: https://nttftrg.com/
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...Amil Baba Dawood bangali
Contact with Dawood Bhai Just call on +92322-6382012 and we'll help you. We'll solve all your problems within 12 to 24 hours and with 101% guarantee and with astrology systematic. If you want to take any personal or professional advice then also you can call us on +92322-6382012 , ONLINE LOVE PROBLEM & Other all types of Daily Life Problem's.Then CALL or WHATSAPP us on +92322-6382012 and Get all these problems solutions here by Amil Baba DAWOOD BANGALI
#vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore#blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #blackmagicforlove #blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #Amilbabainuk #amilbabainspain #amilbabaindubai #Amilbabainnorway #amilbabainkrachi #amilbabainlahore #amilbabaingujranwalan #amilbabainislamabad
1. 18CSS101J
Programming for Problem Solving
UNIT I
Dr.A.Kathirvel, Professor
Dept. of Computer Science and Engineering
Faculty of Engineering &Technology,
SRM Institute of Science andTechnology, Vadapalani campus,
Chennai
2. RESOURCES
Sno BOOK
1 Zed A Shaw,Learn C the HardWay:Practical Exercises on
the Computational SubjectsYou Keep Avoiding (Like C),
AddisonWesley,2015
2 W.Kernighan,Dennis M.Ritchie,The C Programming
Language,2nd ed.Prentice Hall,1996
3 Bharat Kinariwala,Tep Dobry,Programming in C,eBook
4 http://www.c4learn.com/learn-c-programming-
language/
3. outline
Evolution of Programming & Languages
Why Study Programming Languages?
How to Study Programming Languages?
History
4. UNIT 1 INTRODUCTION
Evolution of Programming & Languages - Problem Solving
through Programming - Creating Algorithms - Drawing
Flowcharts - Writing Pseudocode - Evolution of C language,
its usage history - Input and output functions: Printf and
scanf - Variables and identifiers – Expressions - Single line
and multiline comments - Constants, Keywords - Values,
Names, Scope, Binding, Storage Classes - Numeric Data
types: integer - floating point - Non-Numeric Data types:
char and string - Increment and decrement operator -
Comma, Arrow and Assignment operator - Bitwise and
Sizeof operator
5. Evolution of Programming &
Languages
Why Study Programming Languages?
Express yourself better.
Become a better technical decision-maker.
Learn new languages more easily.
Become more productive.
Design your own language.
Expand your mind.
6. Evolution of Programming &
Languages
How to Study Programming Languages?
By Language
By Concept
7. Evolution of Programming & Languages
History
Early History
Prior to the 1940s we have the Jacquard machine and Ada Lovelace's
programming of the Analytical Engine. Plankalkül is designed in the early 1940s
but never gets popular. It’s a high-level language, yes, but mostly symbolic.
1950s-1960s Rise of natural language-like languages
Grace Hopper leads the COBOL effort (business computing), John McCarthy
leads Lisp (AI), John Backus leads Fortran (scientific computing). Early Algol
becomes popular and eventually we get behemoth multi-purpose languages like
Algol 68 and PL/1.
1970sThe structured programming revolution begins
Languages providing information hiding, such as Modula, CLU, Simula, Mesa,
and Euclid attempt to address the ―software crisis.‖ Structured and modular
features are bolted on to earlier languages.
8. Evolution of Programming & Languages
History
1980s Object-orientation takes over the world
Though begun in the 1960s with Simula and refined in the
1970s at Xerox PARC with Smalltalk, OO—or approximations
to it—explodes in the 1980s with C with Classes (since
renamed C++), Objective-C, Eiffel, and Self. Earlier languages
such as Lisp and Pascal gain OO features, becoming Common
Lisp and Object Pascal, respectively.
1990sTheWorldWideWeb appears
Perl becomes popular. Java, JavaScript, and PHP are created
with web applications in mind.
9. Evolution of Programming &
Languages
History
2000s: Interest in established dynamic languages such as Ruby takes off
Scala shows that static languages can feel dynamic. Clojure arrives as a
dynamic, modern Lisp, leveraging Java’s virtual machine.
2010s: Old things become new again
Multicore processors and ―Big Data‖ revive interest in functional
programming. Older languages such as Python and R, and the newer Julia
language, find use in data science. Net-centric computing and performance
concerns make static typing popular again as Go, Rust, and Swift challenge C
and C++ for native applications.
10. Evolution of Programming & Languages
Fortran — Numeric computation
LISP — Symbolic computation, artificial intelligence
COBOL — Business computation
Algol 60 —Algorithmic description
Algol 68 — Kitchen sink of programming language features
Pascal —Teaching structured programming
Modula — Modular programming
C — Systems programming
SQL — Database applications
Scheme —To simplify Lisp
11. Evolution of Programming &
Languages
Prolog — Expert systems; Natural language processing
Smalltalk —Workstation GUI programming
MATLAB — Numeric computation without having to use Fortran
Ada — Megaprogramming; Embedded systems
C++ — Simulation
ML —Theorem proving
Perl — Scripts, with a focus on text processing
Python —To be an extensible scripting language
Ruby —To be the language Matz wanted (and better than Perl)
Lua — General-purpose scripting
12. Evolution of Programming &
Languages
Java — Compact downloadable executable components
C# —To be the Java of the Microsoft (.NET) world
JavaScript — Client-side scripting for web applications
PHP — Server-side scripting for web applications
Postscript — Formatting of printed documents
XSLT — Hierarchical document transformation
Clojure —To be a modern Lisp-dialect for the JVM
13. Evolution of Programming &
Languages
Dart —To be a better language for modern (web) apps
Go —To build large distributed, interconnected systems
Rust — Large, safe, network clients and servers
Hack —To do PHP-comaptible things while keeping your sanity
Elm —To be a ―delightful language for reliable webapps‖
Julia — Scientific computing in a dynamic language with near compiled-
language speed
Swift — Because it was time to make something more fun than Objective-C for
iOS apps
15. Problem Solving through Programming
Problem
Defined as any question, something involving doubt, uncertainty,
difficulty,situation whose solution is not immediately obvious
Problem Solving
Understand and apply logic
Success in solving any problem is only possible after we have made the
effort to understand the problem at hand
Extract from the problem statement a set of precisely defined tasks
16. Problem Solving through Programming
Problem Solving
CreativeThinking
Proven method for approaching a challenge or opportunity in an imaginative way
Process for innovation that helps explore and reframe the problems faced, come up
with new, innovative responses and solutions and then take action
It is generative, nonjudgmental and expansive
Thinking creatively, a lists of new ideas are generated
CriticalThinking
Engages a diverse range of intellectual skills and activities that are concerned with
evaluating information, our assumptions and our thinking processes in a disciplined
way so that we can think and assess information more comprehensively
It is Analytical, Judgmental and Selective
Thinking critically allows a programmer in making choices
18. Program - Set of instructions that instructs the computer
to do a task
Programming Process
a)Defining the Problem
b)Planning the Solution
c)Coding the Program
d)Testing the Program
e)Documenting the Program
Problem Solving through Programming
20. outline
Creating Algorithms
Definition of Algorithm
Components of Algorithm
Need for Algorithm
Properties of Algorithm
Rules forWriting Algorithm
Example
21. Definition
A step-by-step method for solving a problem or doing a task.
A finite sequence of unambiguous, executable steps or
instructions, which, if followed would ultimately terminate and
give the solution of the problem
Creating Algorithms
22. Components of Algorithm
Starting point
Step Numbers – Positions inAlgorithm
Incoming Information - Input
Control Flow – Order of evaluating Instructions
Statements
Outgoing Information - Output
Ending Point
Creating Algorithms
23. Need for Algorithm
A way to communicate about your problem/solution with
others
A possible way to solve a given problem
A "formalization" of a method, that will be proved
A mandatory first step before implementing a solution
Creating Algorithms
26. Rules forWriting Algorithm
Be consistent
Have well Defined input and output
Do not use any syntax of any specific programming language
Creating Algorithms
27. Example
Problem
Develop an algorithm for finding the largest integer among a list of positive
integers
The algorithm should find the largest integer among a list of any values
The algorithm should be general and not depend on the number of integers
Creating Algorithms
28. Example
Problem
Develop an algorithm for finding the largest integer among a list of positive
integers
The algorithm should find the largest integer among a list of any values
The algorithm should be general and not depend on the number of integers
Solution
First use a small number of integers (for example, five), then extend the
solution to any number of integers
The algorithm receives a list of five integers as input and gives the largest
integer as output
Creating Algorithms
34. Drawing Flowcharts
Definition
Flowchart is a graphical representation of an algorithm. It
makes use of symbols which are connected among them to
indicate the flow of information and processing. The process
of drawing a flowchart for an algorithm is known as
―flowcharting‖.
35. Drawing Flowcharts
Advantages
Diagrammatic representation
Illustrates sequence of operations to be performed
Each step represented by a different symbol
Each Symbol contains short description of the Process
Symbols linked together by arrows
Easy to understand diagrams
Clear Documentation
Helps clarify the understanding of the process
36. Drawing Flowcharts
Guidelines
Flowchart can have only one start and one stop symbol
On-page connectors are referenced using numbers
Off-page connectors are referenced using alphabets
General flow of processes is top to bottom or left to right
Arrows should not cross each other
Only one flow line is used withTerminal Symbol
Only one flow line should come out of a Process symbol
Only one flow line should enter a Decision symbol but multiple
lines may leave the Decision symbol
41. outline
Writing Pseudo code
Definition
Guidelines
Advantages and Disadvantages
Example
42. Writing Pseudo code
Definition
An implementation of an algorithm in the form of annotations
and informative text written in plain English. It has no syntax
like any of the programming language and thus can’t be
compiled or interpreted by the computer.
43. Writing Pseudo code
Guidelines
Write only one Statement per line
Example – Pseudo Code for calculating Salary
READ name, hourly rate, hours worked, deduction rate
Gross pay = hourly rate * hours worked
deduction = gross pay * deduction rate
net pay = gross pay – deduction
WRITE name, gross, deduction, net pay
Capitalize Initial Keyword
Keywords to be written in capital letters
Examples: READ,WRITE, IF, ELSE,WHILE, REPEAT, PRINT
44. Writing Pseudo code
Guidelines
Indent to show Hierarchy
Indentation shows the structure boundaries
Sequence
Selection
Looping
End Multiline structures
Each structure must end properly
Example: IF statement must end with ENDIF
Keep Statements Language independent
Resist the urge to write Pseudo Code in any programming language
45. Writing Pseudo code
Advantages
Easily typed in aWord document
Easily modified
Simple to Use and understand
Implements Structured Concepts
No special symbols are used
No specific syntax is used
Easy to translate into Program
46. Writing Pseudo code
Disadvantages
No accepted Standard
Cannot be compiled and executed
48. Writing Pseudo code
Example 1
Pseudo Code to AddThree Numbers
UseVariables: sum, num1, num2, num3 of type integer
ACCEPT num1,num2,num3
Sum = num1+num2+num3
Print sum
End Program
49. Writing Pseudo code
Example 2
Calculate Sum and product of two numbers
UseVariables: sum, product, num1, num2 of type real
DISPLAY ―Input two Numbers‖
ACCEPT num1,num2
Sum = num1+num2
Print ―The sum is‖, sum
product = num1*num2
Print ―The product is‖, product
End Program
50. outline
Evolution of C language, its usage history
Background
Evolution
Characteristics
Features
Advantages
Disadvantages
51. Evolution of C language, its usage history
Background
C programming language was developed in 1972 by Dennis
Ritchie at bell laboratories of AT&T (American Telephone &
Telegraph), located in the U.S.A.
BCPL and CPL are the earlier ancestors of B Language (CPL is
common Programming Language)
C was developed to overcome the problems of previous
languages such as B, BCPL, etc.
As many of the features were derived from “B” Language
the new language was named as “C”.
Initially, C language was developed to be used in UNIX
operating system.
53. Evolution of C language, its usage history
Characteristics
Low Level (Bitwise) Language Support
Structured Programming
Extensive use of Functions
Efficient use of Pointers
Compactness
Program Portability
LooseTyping
54. Evolution of C language, its usage history
Features
It is a robust language with a rich set of built-in functions and
operators that can be used to write any complex program.
The C compiler combines the capabilities of an assembly
language with features of a high-level language.
Programs Written in C are efficient and fast. This is due to its
variety of data type and powerful operators.
It is many time faster than BASIC.
C is highly portable this means that programs once were
written can be run on another machine with little or no
modification.
55. Evolution of C language, its usage history
Features
Another important feature is its ability to extend itself.
A C program is basically a collection of functions that are
supported by C library. We can also create our own function and
add it to C library.
There are 32 keywords; several standard functions are available
which can be used for developing a program.
C language is the most widely used language in operating
systems and embedded system development today.
56. Evolution of C language, its usage history
Advantages
Compiler based Language
Programming – Easy & Fast
Powerful and Efficient
Portable
Supports Graphics
Supports large number of Operators
Used to Implement Data structures
57. Evolution of C language, its usage history
Disadvantages
Not a strongly typed Language
Use of Same operator for multiple purposes
Not Object Oriented
61. C Structure
Documentation Section
Used for providing Comments
Comment treated as a single white space by Compiler
Ignored at time of Execution: Not Executable
Comment: Sequence of Characters given between /* and */
Example: Program Name, Statement description /*
Program to Find Area of a Circle*/
62. C Structure
Preprocessor Section
Also called as Preprocessor Directive
Also called as Header Files
Not a part of Compiler
Separate step in Compilation Process
Instructs Compiler to do required Preprocessing
Begins with # symbol
Preprocessor written within < >
Examples
#include <stdio.h>
#include <conio.h>
#define PI 3.1412
64. C Structure
Global Declaration Section
Used to Declare Global variable (or) Public variable
Variables are declared outside all functions
Variables can be accessed by all functions in the program
Same variable used my more than one function
65. C Structure
main( ) Section
main( ) written in all small letters (No Capital Letters)
Execution starts with a Opening Brace : {
Divided into two sections: Declaration & Execution
Declaration : DeclareVariables
Executable: Statements within the Braces
Execution ends with a Closing Brace : }
Note:main( ) does not end with a semicolon
66. C Structure
Local Declaration Section
Variables declared within the main( ) program
These variables are called LocalVariables
Variables initialized with basic data types
67. C Structure
Rules for writing C program
All statements should be written in lower case
All statements should end with a semicolon
Upper case letters are used for symbolic constants
Blank spaces can be inserted between words
No blank space while declaring a variable, keyword, constant
Can write one or more statement in same line separated by
comma
Opening and closing of braces should be balanced
68. C Structure
Token
Smallest individual unit of a C program
C program broken into many C tokens
Building Blocks of C program
70. Outline
Input Output Functions
Input and Output Operation
Input and Output Function types
71. Input Output Functions
Ability to Communicate with Users during execution
Input Operation
Feeding data into program
DataTransfer from Input device to Memory
Output Operation
Getting result from Program
DataTransfer from Memory to Output device
Header File : #include<stdio.h>
74. Input Output Function Types
Formatted Input / Output Statements
Reads and writes all types of data values
Arranges data in particular format
Requires Format Specifier to identify Data type
Basic Format Specifiers
%d – Integer
%f – Float
%c – Character
%s - String
84. Input Output Function Types
Unformatted Input / Output Statements
Works only with Character Data type
No need of Format Specifier
Unformatted Input Statements
getch ( ) – Reads alphanumeric characters from
Keyboard
getchar ( ) – Reads one character at a time till enter
key is pressed
85. Input Output Function Types
Unformatted Input / Output Statements
Works only with Character Data type
No need of Format Specifier
Unformatted Input Statements
getch ( ) – Reads alphanumeric characters from
Keyboard
getchar ( ) – Reads one character at a time till enter
key is pressed
gets ( ) – Accepts any string from Keyboard until Enter
Key is pressed
86. Input Output Function Types
Unformatted Output Statements
putch ( ) –Writes alphanumeric characters to Monitor
(Output Device)
putchar ( ) – Prints one character at a time
puts ( ) – Prints a String to Monitor (Output Device)
87. Outline
Variables and Identifier
Definition
Rules for identifier
Variable definition and examples
88. Variables and Identifier
Identifier
A string of alphanumeric characters that begins with an
alphabetic character or an underscore character
There are 63 alphanumeric characters, i.e., 53 alphabetic
characters and 10 digits (i.e., 0-9)
Used to represent various programming elements such as
variables, functions, arrays, structures, unions
The underscore character is considered as a letter in identifiers
(Usually used in the middle of an identifier)
89. Variables and Identifier
Rules for Identifers
Combination of alphabets, digits (or) underscore
First character should be aAlphabet
No special characters other than underscore can be used
No comma / spaces allowed within variable name
A variable name cannot be a keyword
Variable names are case sensitive
90. Variables and Identifier
Variable Definition :Value changes during execution
Identifier for a memory location where data is stored
Variable name length cannot be more than 31 characters
Examples:AVERAGE, height, a, b, sum, mark_1,
gross_pay
91. Variables and Identifier
Variable Declaration
A variable must be declared before it is used
Declaration consists of a data type followed by one or more
variable names separated by commas.
Syntax
datatype variablename;
Examples int a,b,c,sum;
float avg;
char name;
92. Variables and Identifier
Variable Initialization
Assigning a value to the declared variable
Values assigned during declaration / after declaration
Examples
i.int a,b,c;a=10,b=20,c=30;
ii.int a=10 ,b=10,c=10;
93. Outline
Expressions
Single line and multiline comments
Constants
Keywords
Scope of variable
Local variable with example
Global variable with example
Binding
94. Expressions
Expression : An Expression is a collection of operators
and operands that represents a specific value
Operator : A symbol which performs tasks like
arithmetic operations, logical operations and
conditional operations
Operands : The values on which the operators perform
the task
ExpressionTypes in C
Infix Expression
Postfix Expression
Prefix Expression
95. Expressions
Infix Expression
The operator is used between operands
General Structure :Operand1 Operator Operand2
Example :a + b
Postfix Expression
Operator is used after operands
General Structure :Operand1 Operand2 Operator
Example :ab+
Prefix Expression
Operator is used before operands
General Structure :Operator Operand1 Operand2
Example :+ab
99. Constants
Definition :Value does not change during execution
Can be a Number (or) a Letter
Types
Integer Constants
Real Constants
Character Constant
Single Character Constants
String Constants
103. Scope of Variables
Scope ofVariables
Definition
A scope in any programming is a region of the program where a defined
variable can have its existence and beyond that variable it cannot be
accessed
Variable Scope is a region in a program where a
variable is declared and used
The scope of a variable is the range of program statements
that can access that variable
A variable is visible within its scope and invisible outside it
104. Scope of Variables
There are three places where variables can be declared
a)Inside a function or a block which is called local
variables
b)Outside of all functions which is called global
variables
c)In the definition of function parameters which are
called formal parameters
105. Scope of Variables
LocalVariables
Variables that are declared inside a function or block are called
local variables
They can be used only by statements that are inside that
function or block of code
Local variables are created when the control reaches the block
or function containing the local variables and then they get
destroyed after that
Local variables are not known to functions outside their own.
107. Scope of Variables
GlobalVariables
Defined outside a function, usually on top of the program
Hold their values throughout the lifetime of the program
Can be accessed inside any of the functions defined for the
program
Can be accessed by any function
That is, a global variable is available for use throughout the
entire program after its declaration
109. Binding
Binding refers to the process of converting identifiers (such as
variable and performance names) into addresses.
Binding is done for each variable and functions. For functions, it
means that matching the call with the right function definition by
the compiler.
110. Outline
Storage Classes
Numeric Data types : integer - floating point
Non-Numeric Data types: char and string
111. Storage Classes
A storage class defines the scope (visibility) and life-time of
variables and/or functions within a C Program. They precede the
type that they modify. We have four different storage classes in a C
program
auto
register
static
extern
112. Storage Classes
The auto storage class is the default storage class for all local
variables.
{
int mount; auto int month;
}
The example above defines two variables with in the same storage class.
'auto' can only be used within functions, i.e., local variables.
113. Storage Classes
The register storage class is used to define local variables that
should be stored in a register instead of RAM. This means that the
variable has a maximum size equal to the register size (usually one
word) and can't have the unary '&' operator applied to it (as it does
not have a memory location).
{ register int miles; }
The register should only be used for variables that require quick
access such as counters. It should also be noted that defining
'register' does not mean that the variable will be stored in a
register. It means that it MIGHT be stored in a register depending
on hardware and implementation restrictions.
114. Storage Classes
The static storage class instructs the compiler to keep a local
variable in existence during the life-time of the program instead of
creating and destroying it each time it comes into and goes out of
scope. Therefore, making local variables static allows them to
maintain their values between function calls.
The static modifier may also be applied to global variables. When
this is done, it causes that variable's scope to be restricted to the
file in which it is declared.
In C programming, when static is used on a global variable, it
causes only one copy of that member to be shared by all the
objects of its class.
115. Storage Classes
#include <stdio.h>
/* function declaration */
void func(void);
static int count = 5;
/* global variable */
main()
{ while(count--) { func(); } return 0; }
/* function definition */
void func( void )
{ static int i = 5;
/* local static variable */
i++;
printf("i is %d and count is %dn", i, count); }
116. Storage Classes
When the above code is compiled and executed, it produces the
following result
i is 6 and count is 4
i is 7 and count is 3
i is 8 and count is 2
i is 9 and count is 1
i is 10 and count is 0
117. Storage Classes
The extern storage class is used to give a reference of a global
variable that is visible to ALL the program files. When you use
'extern', the variable cannot be initialized however, it points the
variable name at a storage location that has been previously
defined.
When you have multiple files and you define a global variable or
function, which will also be used in other files, then extern will be
used in another file to provide the reference of defined variable or
function. Just for understanding, extern is used to declare a global
variable or function in another file.
118. Storage Classes
First File: main.c
#include <stdio.h>
int count ;
extern void write_extern();
main() { count = 5; write_extern(); }
Second File: support.c
#include <stdio.h>
extern int count;
void write_extern(void)
{ printf("count is %dn", count); }
119. Storage Classes
Here, extern is being used to declare count in the second file, where
as it has its definition in the first file, main.c. Now, compile these
two files as follows −
$gcc main.c support.c It will produce the executable
program a.out. When this program is executed, it produces the
following result −
count is 5
120. Data types
Defines a variable before use
Specifies the type of data to be stored in variables
Basic DataTypes – 4 Classes
int – Signed or unsigned number
float – Signed or unsigned number having Decimal Point
double – Double Precision Floating point number
char –A Character in the character Set
127. Operators
C supports rich set of built in Operators
Used to manipulate Constants (Data) &Variables
Part of Mathematical (or) Logical expressions
Operators vs Operands
Operator – Definition
Symbol (or) Special character that instructs the
compiler to perform mathematical (or) Logical
operations
128. Operators
Increment and Decrement Operators
Increment and decrement operators are unary operators that
add or subtract one from their operand
C languages feature two versions (pre- and post-) of each
operator
Operator placed before variable (Pre)
Operator placed before variable (Post)
The increment operator is written as ++ and the decrement
operator is written as --
129. Operators
Increment and Decrement Operators
Classification
Pre Increment Operator
Post Increment Operator
Pre Decrement Operator
Post Decrement Operator