SlideShare a Scribd company logo
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
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/
outline
 Evolution of Programming & Languages
 Why Study Programming Languages?
 How to Study Programming Languages?
 History
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
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.
Evolution of Programming &
Languages
 How to Study Programming Languages?
 By Language
 By Concept
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.
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.
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.
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
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
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
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
outline
 Problem Solving through Programming
 Problem
 Problem Solving
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
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
Problem Solving through Programming
 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
Problem Solving through Programming
outline
 Creating Algorithms
 Definition of Algorithm
 Components of Algorithm
 Need for Algorithm
 Properties of Algorithm
 Rules forWriting Algorithm
 Example
 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
 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
 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
 Properties of Algorithm
 Finiteness
 Definiteness
 Effectiveness
 Input
 Output
 Generality
Creating Algorithms
 Properties of Algorithm
 Finiteness
 Definiteness
 Effectiveness
 Input
 Output
 Generality
Creating Algorithms
 Rules forWriting Algorithm
 Be consistent
 Have well Defined input and output
 Do not use any syntax of any specific programming language
Creating Algorithms
 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
 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
Creating Algorithms
 Example
Creating Algorithms
 Example
Creating Algorithms
 Example
Creating Algorithms
 Example
outline
 Drawing Flowcharts
 Definition
 Advantages
 Guidelines
 Symbols
 Example
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‖.
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
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
Drawing Flowcharts
Drawing Flowcharts
Example 1 Sum of two numbers
Example 2 Factorial
outline
 Writing Pseudo code
 Definition
 Guidelines
 Advantages and Disadvantages
 Example
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.
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
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
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
Writing Pseudo code
 Disadvantages
 No accepted Standard
 Cannot be compiled and executed
Writing Pseudo code
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
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
outline
 Evolution of C language, its usage history
 Background
 Evolution
 Characteristics
 Features
 Advantages
 Disadvantages
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.
Evolution of C language, its usage history
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
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.
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.
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
Evolution of C language, its usage history
 Disadvantages
 Not a strongly typed Language
 Use of Same operator for multiple purposes
 Not Object Oriented
outline
 C Structure
 Parts
 Rules forWriting C Program
 Token
C Structure
C Structure
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*/
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
C Structure
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
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
C Structure
 Local Declaration Section
 Variables declared within the main( ) program
 These variables are called LocalVariables
 Variables initialized with basic data types
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
C Structure
 Token
 Smallest individual unit of a C program
 C program broken into many C tokens
 Building Blocks of C program
C Structure
Outline
 Input Output Functions
 Input and Output Operation
 Input and Output Function types
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>
Input Output Function Types
 Formatted Input / Output Statements
 Unformatted Input / Output Statements
Input Output Function Types
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
Input Output Function Types
Input Output Function Types
Input Output Function Types
Input Output Function Types
Input Output Function Types
Input Output Function Types
Input Output Function Types
Input Output Function Types
Input Output Function Types
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
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
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)
Outline
 Variables and Identifier
 Definition
 Rules for identifier
 Variable definition and examples
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)
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
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
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;
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;
Outline
 Expressions
 Single line and multiline comments
 Constants
 Keywords
 Scope of variable
 Local variable with example
 Global variable with example
 Binding
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
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
Single line and multi line comments
Single line and multi line comments
Single line and multi line comments
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
Constants
Keywords
Scope of Variables
 Scope ofVariables
 LocalVariables
 GlobalVariables
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
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
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.
Scope of Variables
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
Scope of Variables
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.
Outline
 Storage Classes
 Numeric Data types : integer - floating point
 Non-Numeric Data types: char and string
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
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.
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.
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.
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); }
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
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.
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); }
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
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
Data types
Data types
Data types
Data types
Data types
Outline
 Operators
 Increment & Decrement Operators
 Comma Operator
 Arrow Operator
 Assignment Operators
 Bitwise Operators
 Sizeof Operator
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
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 --
Operators
 Increment and Decrement Operators
 Classification
 Pre Increment Operator
 Post Increment Operator
 Pre Decrement Operator
 Post Decrement Operator
Operators
Operators
Operators
Operators
Operators
Operators
Operators
Operators
Operators
Operators
Operators
Operators
Operators
Operators
Operators
Operators

More Related Content

What's hot

C language ppt
C language pptC language ppt
C language ppt
Ğäùråv Júñêjå
 
Python programming : Classes objects
Python programming : Classes objectsPython programming : Classes objects
Python programming : Classes objects
Emertxe Information Technologies Pvt Ltd
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
kamal kotecha
 
Strings in python
Strings in pythonStrings in python
Strings in python
Prabhakaran V M
 
Introduction to python for Beginners
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners
Sujith Kumar
 
Introduction to theory of computation
Introduction to theory of computationIntroduction to theory of computation
Introduction to theory of computation
Vinod Tyagi
 
Machine learning with Big Data power point presentation
Machine learning with Big Data power point presentationMachine learning with Big Data power point presentation
Machine learning with Big Data power point presentation
David Raj Kanthi
 
structured programming Introduction to c fundamentals
structured programming Introduction to c fundamentalsstructured programming Introduction to c fundamentals
structured programming Introduction to c fundamentals
OMWOMA JACKSON
 
Functions in C
Functions in CFunctions in C
Functions in C
Kamal Acharya
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1Manoj Patil
 
Array in c#
Array in c#Array in c#
Array in c#
Prem Kumar Badri
 
Datastructures in python
Datastructures in pythonDatastructures in python
Datastructures in python
hydpy
 
Programming in c
Programming in cProgramming in c
Programming in c
indra Kishor
 
Conditional and control statement
Conditional and control statementConditional and control statement
Conditional and control statement
narmadhakin
 
Object oriented programming c++
Object oriented programming c++Object oriented programming c++
Object oriented programming c++
Ankur Pandey
 
best notes in c language
best notes in c languagebest notes in c language
best notes in c language
India
 
String in c programming
String in c programmingString in c programming
String in c programming
Devan Thakur
 
Data Structures in Python
Data Structures in PythonData Structures in Python
Data Structures in Python
Devashish Kumar
 
Procedural programming
Procedural programmingProcedural programming
Procedural programming
Ankit92Chitnavis
 

What's hot (20)

C language ppt
C language pptC language ppt
C language ppt
 
Methods in Java
Methods in JavaMethods in Java
Methods in Java
 
Python programming : Classes objects
Python programming : Classes objectsPython programming : Classes objects
Python programming : Classes objects
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
 
Strings in python
Strings in pythonStrings in python
Strings in python
 
Introduction to python for Beginners
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners
 
Introduction to theory of computation
Introduction to theory of computationIntroduction to theory of computation
Introduction to theory of computation
 
Machine learning with Big Data power point presentation
Machine learning with Big Data power point presentationMachine learning with Big Data power point presentation
Machine learning with Big Data power point presentation
 
structured programming Introduction to c fundamentals
structured programming Introduction to c fundamentalsstructured programming Introduction to c fundamentals
structured programming Introduction to c fundamentals
 
Functions in C
Functions in CFunctions in C
Functions in C
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1
 
Array in c#
Array in c#Array in c#
Array in c#
 
Datastructures in python
Datastructures in pythonDatastructures in python
Datastructures in python
 
Programming in c
Programming in cProgramming in c
Programming in c
 
Conditional and control statement
Conditional and control statementConditional and control statement
Conditional and control statement
 
Object oriented programming c++
Object oriented programming c++Object oriented programming c++
Object oriented programming c++
 
best notes in c language
best notes in c languagebest notes in c language
best notes in c language
 
String in c programming
String in c programmingString in c programming
String in c programming
 
Data Structures in Python
Data Structures in PythonData Structures in Python
Data Structures in Python
 
Procedural programming
Procedural programmingProcedural programming
Procedural programming
 

Similar to Programming for Problem Solving

PL Lecture 01 - preliminaries
PL Lecture 01 - preliminariesPL Lecture 01 - preliminaries
PL Lecture 01 - preliminaries
Schwannden Kuo
 
Programing paradigm &amp; implementation
Programing paradigm &amp; implementationPrograming paradigm &amp; implementation
Programing paradigm &amp; implementation
Bilal Maqbool ツ
 
week1.ppt
week1.pptweek1.ppt
week1.ppt
nazimsattar
 
Software_engineering.pptx
Software_engineering.pptxSoftware_engineering.pptx
Software_engineering.pptx
john6938
 
Unit 4 Assignment 1 Comparative Study Of Programming...
Unit 4 Assignment 1 Comparative Study Of Programming...Unit 4 Assignment 1 Comparative Study Of Programming...
Unit 4 Assignment 1 Comparative Study Of Programming...
Carmen Sanborn
 
Sudipta_Mukherjee_Resume_APR_2023.pdf
Sudipta_Mukherjee_Resume_APR_2023.pdfSudipta_Mukherjee_Resume_APR_2023.pdf
Sudipta_Mukherjee_Resume_APR_2023.pdf
sudipto801
 
History Of C Essay
History Of C EssayHistory Of C Essay
History Of C Essay
Melissa Williams
 
Intro. to prog. c++
Intro. to prog. c++Intro. to prog. c++
Intro. to prog. c++
KurdGul
 
intro.pptx
intro.pptxintro.pptx
intro.pptx
MelbornGatmaitan
 
1 puc programming using c++
1 puc programming using c++1 puc programming using c++
1 puc programming using c++
Prof. Dr. K. Adisesha
 
BCE L-1 Programmimg languages.pptx
BCE L-1  Programmimg languages.pptxBCE L-1  Programmimg languages.pptx
BCE L-1 Programmimg languages.pptx
Kirti Verma
 
Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming languageVasavi College of Engg
 
Plc part 1
Plc part 1Plc part 1
Plc part 1
Taymoor Nazmy
 
Expressiveness, Simplicity and Users
Expressiveness, Simplicity and UsersExpressiveness, Simplicity and Users
Expressiveness, Simplicity and Users
greenwop
 
Are High Level Programming Languages for Multicore and Safety Critical Conver...
Are High Level Programming Languages for Multicore and Safety Critical Conver...Are High Level Programming Languages for Multicore and Safety Critical Conver...
Are High Level Programming Languages for Multicore and Safety Critical Conver...
InfinIT - Innovationsnetværket for it
 
Sudipta_Mukherjee_Resume-Nov_2022.pdf
Sudipta_Mukherjee_Resume-Nov_2022.pdfSudipta_Mukherjee_Resume-Nov_2022.pdf
Sudipta_Mukherjee_Resume-Nov_2022.pdf
Sudipta Mukherjee
 
OBJECT ORIENTED PROGRAMMING.docx
OBJECT ORIENTED PROGRAMMING.docxOBJECT ORIENTED PROGRAMMING.docx
OBJECT ORIENTED PROGRAMMING.docx
AleKi2
 
Resume
ResumeResume
Resume
muddanas
 
Srinivas Muddana Resume
Srinivas Muddana ResumeSrinivas Muddana Resume
Srinivas Muddana Resume
muddanas
 

Similar to Programming for Problem Solving (20)

PL Lecture 01 - preliminaries
PL Lecture 01 - preliminariesPL Lecture 01 - preliminaries
PL Lecture 01 - preliminaries
 
Programing paradigm &amp; implementation
Programing paradigm &amp; implementationPrograming paradigm &amp; implementation
Programing paradigm &amp; implementation
 
week1.ppt
week1.pptweek1.ppt
week1.ppt
 
Software_engineering.pptx
Software_engineering.pptxSoftware_engineering.pptx
Software_engineering.pptx
 
Unit 4 Assignment 1 Comparative Study Of Programming...
Unit 4 Assignment 1 Comparative Study Of Programming...Unit 4 Assignment 1 Comparative Study Of Programming...
Unit 4 Assignment 1 Comparative Study Of Programming...
 
Sudipta_Mukherjee_Resume_APR_2023.pdf
Sudipta_Mukherjee_Resume_APR_2023.pdfSudipta_Mukherjee_Resume_APR_2023.pdf
Sudipta_Mukherjee_Resume_APR_2023.pdf
 
History Of C Essay
History Of C EssayHistory Of C Essay
History Of C Essay
 
Intro. to prog. c++
Intro. to prog. c++Intro. to prog. c++
Intro. to prog. c++
 
intro.pptx
intro.pptxintro.pptx
intro.pptx
 
1 puc programming using c++
1 puc programming using c++1 puc programming using c++
1 puc programming using c++
 
BCE L-1 Programmimg languages.pptx
BCE L-1  Programmimg languages.pptxBCE L-1  Programmimg languages.pptx
BCE L-1 Programmimg languages.pptx
 
Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming language
 
Plc part 1
Plc part 1Plc part 1
Plc part 1
 
Expressiveness, Simplicity and Users
Expressiveness, Simplicity and UsersExpressiveness, Simplicity and Users
Expressiveness, Simplicity and Users
 
Are High Level Programming Languages for Multicore and Safety Critical Conver...
Are High Level Programming Languages for Multicore and Safety Critical Conver...Are High Level Programming Languages for Multicore and Safety Critical Conver...
Are High Level Programming Languages for Multicore and Safety Critical Conver...
 
Lec 1 25_jul13
Lec 1 25_jul13Lec 1 25_jul13
Lec 1 25_jul13
 
Sudipta_Mukherjee_Resume-Nov_2022.pdf
Sudipta_Mukherjee_Resume-Nov_2022.pdfSudipta_Mukherjee_Resume-Nov_2022.pdf
Sudipta_Mukherjee_Resume-Nov_2022.pdf
 
OBJECT ORIENTED PROGRAMMING.docx
OBJECT ORIENTED PROGRAMMING.docxOBJECT ORIENTED PROGRAMMING.docx
OBJECT ORIENTED PROGRAMMING.docx
 
Resume
ResumeResume
Resume
 
Srinivas Muddana Resume
Srinivas Muddana ResumeSrinivas Muddana Resume
Srinivas Muddana Resume
 

More from Kathirvel Ayyaswamy

22CS201 COA
22CS201 COA22CS201 COA
22CS201 COA
Kathirvel Ayyaswamy
 
22cs201 COMPUTER ORGANIZATION AND ARCHITECTURE
22cs201 COMPUTER ORGANIZATION AND ARCHITECTURE22cs201 COMPUTER ORGANIZATION AND ARCHITECTURE
22cs201 COMPUTER ORGANIZATION AND ARCHITECTURE
Kathirvel Ayyaswamy
 
22CS201 COA
22CS201 COA22CS201 COA
22CS201 COA
Kathirvel Ayyaswamy
 
18CS3040_Distributed Systems
18CS3040_Distributed Systems18CS3040_Distributed Systems
18CS3040_Distributed Systems
Kathirvel Ayyaswamy
 
20CS2021-Distributed Computing module 2
20CS2021-Distributed Computing module 220CS2021-Distributed Computing module 2
20CS2021-Distributed Computing module 2
Kathirvel Ayyaswamy
 
18CS3040 Distributed System
18CS3040 Distributed System	18CS3040 Distributed System
18CS3040 Distributed System
Kathirvel Ayyaswamy
 
20CS2021 Distributed Computing
20CS2021 Distributed Computing 20CS2021 Distributed Computing
20CS2021 Distributed Computing
Kathirvel Ayyaswamy
 
20CS2021 DISTRIBUTED COMPUTING
20CS2021 DISTRIBUTED COMPUTING20CS2021 DISTRIBUTED COMPUTING
20CS2021 DISTRIBUTED COMPUTING
Kathirvel Ayyaswamy
 
18CS3040 DISTRIBUTED SYSTEMS
18CS3040 DISTRIBUTED SYSTEMS18CS3040 DISTRIBUTED SYSTEMS
18CS3040 DISTRIBUTED SYSTEMS
Kathirvel Ayyaswamy
 
Recent Trends in IoT and Sustainability
Recent Trends in IoT and SustainabilityRecent Trends in IoT and Sustainability
Recent Trends in IoT and Sustainability
Kathirvel Ayyaswamy
 
20CS2008 Computer Networks
20CS2008 Computer Networks 20CS2008 Computer Networks
20CS2008 Computer Networks
Kathirvel Ayyaswamy
 
18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security
Kathirvel Ayyaswamy
 
18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security
Kathirvel Ayyaswamy
 
18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security
Kathirvel Ayyaswamy
 
18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security 18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security
Kathirvel Ayyaswamy
 
18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security
Kathirvel Ayyaswamy
 
18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security
Kathirvel Ayyaswamy
 
20CS2008 Computer Networks
20CS2008 Computer Networks20CS2008 Computer Networks
20CS2008 Computer Networks
Kathirvel Ayyaswamy
 
20CS2008 Computer Networks
20CS2008 Computer Networks 20CS2008 Computer Networks
20CS2008 Computer Networks
Kathirvel Ayyaswamy
 
20CS024 Ethics in Information Technology
20CS024 Ethics in Information Technology20CS024 Ethics in Information Technology
20CS024 Ethics in Information Technology
Kathirvel Ayyaswamy
 

More from Kathirvel Ayyaswamy (20)

22CS201 COA
22CS201 COA22CS201 COA
22CS201 COA
 
22cs201 COMPUTER ORGANIZATION AND ARCHITECTURE
22cs201 COMPUTER ORGANIZATION AND ARCHITECTURE22cs201 COMPUTER ORGANIZATION AND ARCHITECTURE
22cs201 COMPUTER ORGANIZATION AND ARCHITECTURE
 
22CS201 COA
22CS201 COA22CS201 COA
22CS201 COA
 
18CS3040_Distributed Systems
18CS3040_Distributed Systems18CS3040_Distributed Systems
18CS3040_Distributed Systems
 
20CS2021-Distributed Computing module 2
20CS2021-Distributed Computing module 220CS2021-Distributed Computing module 2
20CS2021-Distributed Computing module 2
 
18CS3040 Distributed System
18CS3040 Distributed System	18CS3040 Distributed System
18CS3040 Distributed System
 
20CS2021 Distributed Computing
20CS2021 Distributed Computing 20CS2021 Distributed Computing
20CS2021 Distributed Computing
 
20CS2021 DISTRIBUTED COMPUTING
20CS2021 DISTRIBUTED COMPUTING20CS2021 DISTRIBUTED COMPUTING
20CS2021 DISTRIBUTED COMPUTING
 
18CS3040 DISTRIBUTED SYSTEMS
18CS3040 DISTRIBUTED SYSTEMS18CS3040 DISTRIBUTED SYSTEMS
18CS3040 DISTRIBUTED SYSTEMS
 
Recent Trends in IoT and Sustainability
Recent Trends in IoT and SustainabilityRecent Trends in IoT and Sustainability
Recent Trends in IoT and Sustainability
 
20CS2008 Computer Networks
20CS2008 Computer Networks 20CS2008 Computer Networks
20CS2008 Computer Networks
 
18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security
 
18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security
 
18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security
 
18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security 18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security
 
18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security
 
18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security
 
20CS2008 Computer Networks
20CS2008 Computer Networks20CS2008 Computer Networks
20CS2008 Computer Networks
 
20CS2008 Computer Networks
20CS2008 Computer Networks 20CS2008 Computer Networks
20CS2008 Computer Networks
 
20CS024 Ethics in Information Technology
20CS024 Ethics in Information Technology20CS024 Ethics in Information Technology
20CS024 Ethics in Information Technology
 

Recently uploaded

在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERSCW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
veerababupersonal22
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
ClaraZara1
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABSDESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
itech2017
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
The Role of Electrical and Electronics Engineers in IOT Technology.pdf
The Role of Electrical and Electronics Engineers in IOT Technology.pdfThe Role of Electrical and Electronics Engineers in IOT Technology.pdf
The Role of Electrical and Electronics Engineers in IOT Technology.pdf
Nettur Technical Training Foundation
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Basic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparelBasic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparel
top1002
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 

Recently uploaded (20)

在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERSCW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABSDESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
The Role of Electrical and Electronics Engineers in IOT Technology.pdf
The Role of Electrical and Electronics Engineers in IOT Technology.pdfThe Role of Electrical and Electronics Engineers in IOT Technology.pdf
The Role of Electrical and Electronics Engineers in IOT Technology.pdf
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Basic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparelBasic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparel
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 

Programming for Problem Solving

  • 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
  • 14. outline  Problem Solving through Programming  Problem  Problem Solving
  • 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
  • 17. Problem Solving through Programming
  • 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
  • 19. 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
  • 24.  Properties of Algorithm  Finiteness  Definiteness  Effectiveness  Input  Output  Generality Creating Algorithms
  • 25.  Properties of Algorithm  Finiteness  Definiteness  Effectiveness  Input  Output  Generality 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
  • 33. outline  Drawing Flowcharts  Definition  Advantages  Guidelines  Symbols  Example
  • 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
  • 39. Example 1 Sum of two numbers
  • 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.
  • 52. Evolution of C language, its usage history
  • 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
  • 58. outline  C Structure  Parts  Rules forWriting C Program  Token
  • 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>
  • 72. Input Output Function Types  Formatted Input / Output Statements  Unformatted Input / Output Statements
  • 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
  • 96. Single line and multi line comments
  • 97. Single line and multi line comments
  • 98. Single line and multi line comments
  • 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
  • 102. Scope of Variables  Scope ofVariables  LocalVariables  GlobalVariables
  • 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
  • 126. Outline  Operators  Increment & Decrement Operators  Comma Operator  Arrow Operator  Assignment Operators  Bitwise Operators  Sizeof Operator
  • 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