SlideShare a Scribd company logo
 FLOW CHARTS
 PSEUDO CODE
 They are very precise. They represent our
thoughts exactly.
FUNDAMENTAL CONDITIONAL AND
CONTROL STRUCTURES:
Branching:
Two way branching:
Eg: if A > B, then Print A, otherwise
Print B
Multiway branching:
Eg: if n is 0, then Print ‘ zero’
1, then Print ‘ one’
2, then Print ‘ two’
3, then Print ‘ three’
ITERATION:
The third fundamental technique is
Iteration. It means repeating a set of
actions again and again.
 Pseudo code can be used to represent a
procedure for doing something.
 These are in between the English and the high
level computer languages.
The flow chart fundamental control structures
for branching and iteration correspond to the
following pseudo code.
 if…then…else
 if…then
 For…to…do…
 While…do…
Consider the statement:
number = number + 1;
The tokens are,
number - identifer
(variable)
= - operator
+ - operator
1 - constant
; - punctuation
A constant is of numeric or non-numeric type.
It can be a number, a character or a character
string that can be used as a value in a
program.
 Numeric constants are of three types:
• integer constant
• floating-point constant
• character constant
 A non-numeric data can be called as a literal.
String Literal:
A string literal or a string constant is
a sequence of characters from the system’s
character set, enclosed in double quotes.
 Integer Constant:
An integer constant is a decimal number
(base 10) that represents an integral value (the
whole number). It comprises of the
digits 0 to 9.
 Floating - point Constant
A floating-point constant is a signed real
number. It includes integer portion, a decimal
point, fractional portion and an exponent. Eg.
5.864E1
 Character Constant
A character is a letter, numeral or special symbol,
which can be handled by the computer system.
These available symbols define the system’s
character set.
Eg. ‘1’, ‘a’, ‘+’, and ‘-‘ are the valid character
constants.
 Identifiers are the names that are to be given to the variables, functions,
data types and labels in a program.
 The name of a variable can consist of alphabets (letters) and numbers.
 Other characters are not allowed in the name of a variable except an
underscore character.
 The variable name starts with an alphabet and its length may vary from one
character to 32 characters.
 The first character in a variable’s name should be an alphabet,
 Keywords (which have special meaning in C) cannot be used as identifiers
The valid variable names are:
 x
 length
 x_value
 y_value
 A123
POINTER VARIABLES
The variables in C are classified into ordinary
variables and pointer variables.
int x;
x = 10;
int *y;
A pointer variable assumes only address as its value. Each
variable takes some locations in the main memory according
to its type. Every location in the main memory is addressable.
y=&x;
• y represents the address of the variable x (&x)
• *y represents the value of the variable x (x)
UNARY
BINARY
TERNARY
Variable = Expression;
i++ postfix form
++i prefix form
c = a+b; arithmetic expression
c = a > b; relational expression
f = d = e; assignment expression
x = i++; /*postfix increment
expression on the right side*/
printf()
scanf()
 [ ] - represent array index
 { } - cover the body of the function
 ( ) - represent a function, to group items
 < > - enclose a header file in a preprocessor statement
 “ “ - represent string literals
 ‘ ‘ - represent a character constant
 /* */ - represent a comment
 ; - a statement terminator
 , - to separate items
KEYWORDS
They cannot be used as identifiers for the variables in a program.
auto break case char continue default
do else if float for int return static
switch while
A keyword must be specified precisely as given in the list.
 Each and every line of a C program can be
considered as a statement. There are
generally four types of statements. They are:
 • Preprocessor statement
 • Function header statement
 • Declaration statement
 • Executable statement
#include <stdio.h> => Preprocessor Statement
main() => Function header Statement
{
int a,b,c; => Variable declaration statement
int add(int,int); => Function declaration statement
a = 10; => Executable statement
}
PRINTF() STATEMENT:
PRINTF( FORMATTING STRING, CONTROL STRING)
printf(“%d”, n);
Formatting character Data type
%d int
%f float
%c char
%s char [ ]
%ld long int
%lf long float or double
control string of printf() function are:
‘n’ - new line character
‘t’ - tab character
‘b’ - backspace character
Eg: printf(“the value of i = %d n”, i);
 To read a value from the keyboard (standard
input), the function scanf() is used.
 The prototype of scanf() is similar to the
prototype of printf().
int x;
scanf(“%d”, &x);
• The second parameter of the above scanf()
function is &x, which represents the
address of x.
• & is the address of operator and when it is
being used with a variable, it provides the
address of that variable.
 The user or programmer can write functions to
define specific tasks that may be used at many
points in a program.
 The function which calls another function is
termed as calling function and the other is
termed as called function.
 A function declaration may be called
as a function prototype or a function model. The
function prototype has four components.
• Name of the function
• Return value type
• Number of parameters
• Type of each parameter
Function
protype
Function
definition
Storage
classes
auto
extern
register
static
if
• if(relational
expression)
• statement1
if..else
• if(relational
expression)
• statement1;
• else
• statement2;
switchcase
• switch(cond.expr.)
• {
• case1 expr1:
• ....
• break;
• case2 expr2:
• ....
• break;
• default:
• }
while do...while for
•
Initialization
while(condition)
{
……..;
processing stmts
…….;
increment
}
for(initialization;
condition;
increment)
{
body of the loop;
}
do
{
…….;
}
while(condition);
 DEFINITION:
An array is a collection of homogeneous elements
i.e. elements of similar data type.
 EXAMPLE:
int a[100];
 DECLARATION STMT:
int a[10]; /* => array declaration statement */
a[0]=6; a[1]= 7; …..a[99]=67;
A multidimensional
array has been
considered as an
array of
arrays in C language
DECLARATION
int a[3][3];
a[0] =[ 1 2 3 ]
a[1] =[ 4 5 6 ]
a[2] =[ 7 8 9 ]
 Structures are derived data types in C
language.
 Structures are used to create user-defined
types. Structures are commonly used to
define records to be stored in files.
 A file is a collection of records.
 A record is a collection of fields of
information.
 Roll number: an integer field
 Name: an array of characters
 age: an integer field
 Consider the following structure definition:
Eg:
struct student
{
int rollno;
char name[24];
init age;
} x, y;
Accessing the members of the
Structures:
x.rollno = 1000;
y.rollno = 1001;
Pointers to Structures:
struct student *ptr;
struct student s1;
ptr = &s1;
An Array of Structures:
struct student x[5];
x[0].rollno, x[0].name, uctures

More Related Content

What's hot

Constants Variables Datatypes by Mrs. Sowmya Jyothi
Constants Variables Datatypes by Mrs. Sowmya JyothiConstants Variables Datatypes by Mrs. Sowmya Jyothi
Constants Variables Datatypes by Mrs. Sowmya Jyothi
SowmyaJyothi3
 
Ch2 introduction to c
Ch2 introduction to cCh2 introduction to c
Ch2 introduction to c
Hattori Sidek
 
Diploma ii cfpc u-2 datatypes and variables in c language
Diploma ii  cfpc u-2 datatypes and variables in c languageDiploma ii  cfpc u-2 datatypes and variables in c language
Diploma ii cfpc u-2 datatypes and variables in c language
Rai University
 
Unit 2. Elements of C
Unit 2. Elements of CUnit 2. Elements of C
Unit 2. Elements of C
Ashim Lamichhane
 
Variables in C Programming
Variables in C ProgrammingVariables in C Programming
Variables in C Programming
programming9
 
Programming in C Presentation upto FILE
Programming in C Presentation upto FILEProgramming in C Presentation upto FILE
Programming in C Presentation upto FILE
Dipta Saha
 
Mca i pic u-2 datatypes and variables in c language
Mca i pic u-2 datatypes and variables in c languageMca i pic u-2 datatypes and variables in c language
Mca i pic u-2 datatypes and variables in c language
Rai University
 
C language ppt
C language pptC language ppt
C language ppt
Ğäùråv Júñêjå
 
Structure
StructureStructure
Btech i pic u-2 datatypes and variables in c language
Btech i pic u-2 datatypes and variables in c languageBtech i pic u-2 datatypes and variables in c language
Btech i pic u-2 datatypes and variables in c language
Rai University
 
Bsc cs i pic u-2 datatypes and variables in c language
Bsc cs i pic u-2 datatypes and variables in c languageBsc cs i pic u-2 datatypes and variables in c language
Bsc cs i pic u-2 datatypes and variables in c language
Rai University
 
Cpu-fundamental of C
Cpu-fundamental of CCpu-fundamental of C
Cpu-fundamental of C
Suchit Patel
 
Introduction to Basic C programming 01
Introduction to Basic C programming 01Introduction to Basic C programming 01
Introduction to Basic C programming 01
Wingston
 
Clanguage
ClanguageClanguage
Clanguage
Vidyacenter
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
K Durga Prasad
 
Constants in C Programming
Constants in C ProgrammingConstants in C Programming
Constants in C Programming
programming9
 
C introduction
C introductionC introduction
C introduction
AswathyBAnil
 
C language basics
C language basicsC language basics
C language basics
Milind Deshkar
 
Variables in C and C++ Language
Variables in C and C++ LanguageVariables in C and C++ Language
Variables in C and C++ Language
Way2itech
 

What's hot (19)

Constants Variables Datatypes by Mrs. Sowmya Jyothi
Constants Variables Datatypes by Mrs. Sowmya JyothiConstants Variables Datatypes by Mrs. Sowmya Jyothi
Constants Variables Datatypes by Mrs. Sowmya Jyothi
 
Ch2 introduction to c
Ch2 introduction to cCh2 introduction to c
Ch2 introduction to c
 
Diploma ii cfpc u-2 datatypes and variables in c language
Diploma ii  cfpc u-2 datatypes and variables in c languageDiploma ii  cfpc u-2 datatypes and variables in c language
Diploma ii cfpc u-2 datatypes and variables in c language
 
Unit 2. Elements of C
Unit 2. Elements of CUnit 2. Elements of C
Unit 2. Elements of C
 
Variables in C Programming
Variables in C ProgrammingVariables in C Programming
Variables in C Programming
 
Programming in C Presentation upto FILE
Programming in C Presentation upto FILEProgramming in C Presentation upto FILE
Programming in C Presentation upto FILE
 
Mca i pic u-2 datatypes and variables in c language
Mca i pic u-2 datatypes and variables in c languageMca i pic u-2 datatypes and variables in c language
Mca i pic u-2 datatypes and variables in c language
 
C language ppt
C language pptC language ppt
C language ppt
 
Structure
StructureStructure
Structure
 
Btech i pic u-2 datatypes and variables in c language
Btech i pic u-2 datatypes and variables in c languageBtech i pic u-2 datatypes and variables in c language
Btech i pic u-2 datatypes and variables in c language
 
Bsc cs i pic u-2 datatypes and variables in c language
Bsc cs i pic u-2 datatypes and variables in c languageBsc cs i pic u-2 datatypes and variables in c language
Bsc cs i pic u-2 datatypes and variables in c language
 
Cpu-fundamental of C
Cpu-fundamental of CCpu-fundamental of C
Cpu-fundamental of C
 
Introduction to Basic C programming 01
Introduction to Basic C programming 01Introduction to Basic C programming 01
Introduction to Basic C programming 01
 
Clanguage
ClanguageClanguage
Clanguage
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
 
Constants in C Programming
Constants in C ProgrammingConstants in C Programming
Constants in C Programming
 
C introduction
C introductionC introduction
C introduction
 
C language basics
C language basicsC language basics
C language basics
 
Variables in C and C++ Language
Variables in C and C++ LanguageVariables in C and C++ Language
Variables in C and C++ Language
 

Similar to Problem Solving Techniques

unit 1 cpds.pptx
unit 1 cpds.pptxunit 1 cpds.pptx
unit 1 cpds.pptx
madhurij54
 
Pc module1
Pc module1Pc module1
Pc module1
SANTOSH RATH
 
comp 122 Chapter 2.pptx,language semantics
comp 122 Chapter 2.pptx,language semanticscomp 122 Chapter 2.pptx,language semantics
comp 122 Chapter 2.pptx,language semantics
floraaluoch3
 
C intro
C introC intro
C intro
SHIKHA GAUTAM
 
C
CC
Introduction to C++.pptx learn c++ and basic concepts of OOP
Introduction to C++.pptx learn c++ and basic concepts of OOPIntroduction to C++.pptx learn c++ and basic concepts of OOP
Introduction to C++.pptx learn c++ and basic concepts of OOP
UbaidKhan930128
 
C Language (All Concept)
C Language (All Concept)C Language (All Concept)
C Language (All Concept)
sachindane
 
C_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxC_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptx
Likhil181
 
C notes for exam preparation
C notes for exam preparationC notes for exam preparation
C notes for exam preparation
Lakshmi Sarvani Videla
 
Introduction to c
Introduction to cIntroduction to c
Introduction to c
Ajeet Kumar
 
Introduction%20C.pptx
Introduction%20C.pptxIntroduction%20C.pptx
Introduction%20C.pptx
20EUEE018DEEPAKM
 
Chap 1 and 2
Chap 1 and 2Chap 1 and 2
java or oops class not in kerala polytechnic 4rth semester nots j
java or oops class not in kerala polytechnic  4rth semester nots jjava or oops class not in kerala polytechnic  4rth semester nots j
java or oops class not in kerala polytechnic 4rth semester nots j
ishorishore
 
qb unit2 solve eem201.pdf
qb unit2 solve eem201.pdfqb unit2 solve eem201.pdf
qb unit2 solve eem201.pdf
Yashsharma304389
 
Sample for Simple C Program - R.D.Sivakumar
Sample for Simple C Program - R.D.SivakumarSample for Simple C Program - R.D.Sivakumar
Sample for Simple C Program - R.D.Sivakumar
Sivakumar R D .
 
Ch02
Ch02Ch02
Chapter 2: Elementary Programming
Chapter 2: Elementary ProgrammingChapter 2: Elementary Programming
Chapter 2: Elementary Programming
Eric Chou
 
PSPC--UNIT-2.pdf
PSPC--UNIT-2.pdfPSPC--UNIT-2.pdf
PSPC--UNIT-2.pdf
ArshiniGubbala3
 
C programming Training in Ambala ! Batra Computer Centre
C programming Training in Ambala ! Batra Computer CentreC programming Training in Ambala ! Batra Computer Centre
C programming Training in Ambala ! Batra Computer Centre
jatin batra
 
C presentation! BATRA COMPUTER CENTRE
C presentation! BATRA  COMPUTER  CENTRE C presentation! BATRA  COMPUTER  CENTRE
C presentation! BATRA COMPUTER CENTRE
jatin batra
 

Similar to Problem Solving Techniques (20)

unit 1 cpds.pptx
unit 1 cpds.pptxunit 1 cpds.pptx
unit 1 cpds.pptx
 
Pc module1
Pc module1Pc module1
Pc module1
 
comp 122 Chapter 2.pptx,language semantics
comp 122 Chapter 2.pptx,language semanticscomp 122 Chapter 2.pptx,language semantics
comp 122 Chapter 2.pptx,language semantics
 
C intro
C introC intro
C intro
 
C
CC
C
 
Introduction to C++.pptx learn c++ and basic concepts of OOP
Introduction to C++.pptx learn c++ and basic concepts of OOPIntroduction to C++.pptx learn c++ and basic concepts of OOP
Introduction to C++.pptx learn c++ and basic concepts of OOP
 
C Language (All Concept)
C Language (All Concept)C Language (All Concept)
C Language (All Concept)
 
C_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxC_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptx
 
C notes for exam preparation
C notes for exam preparationC notes for exam preparation
C notes for exam preparation
 
Introduction to c
Introduction to cIntroduction to c
Introduction to c
 
Introduction%20C.pptx
Introduction%20C.pptxIntroduction%20C.pptx
Introduction%20C.pptx
 
Chap 1 and 2
Chap 1 and 2Chap 1 and 2
Chap 1 and 2
 
java or oops class not in kerala polytechnic 4rth semester nots j
java or oops class not in kerala polytechnic  4rth semester nots jjava or oops class not in kerala polytechnic  4rth semester nots j
java or oops class not in kerala polytechnic 4rth semester nots j
 
qb unit2 solve eem201.pdf
qb unit2 solve eem201.pdfqb unit2 solve eem201.pdf
qb unit2 solve eem201.pdf
 
Sample for Simple C Program - R.D.Sivakumar
Sample for Simple C Program - R.D.SivakumarSample for Simple C Program - R.D.Sivakumar
Sample for Simple C Program - R.D.Sivakumar
 
Ch02
Ch02Ch02
Ch02
 
Chapter 2: Elementary Programming
Chapter 2: Elementary ProgrammingChapter 2: Elementary Programming
Chapter 2: Elementary Programming
 
PSPC--UNIT-2.pdf
PSPC--UNIT-2.pdfPSPC--UNIT-2.pdf
PSPC--UNIT-2.pdf
 
C programming Training in Ambala ! Batra Computer Centre
C programming Training in Ambala ! Batra Computer CentreC programming Training in Ambala ! Batra Computer Centre
C programming Training in Ambala ! Batra Computer Centre
 
C presentation! BATRA COMPUTER CENTRE
C presentation! BATRA  COMPUTER  CENTRE C presentation! BATRA  COMPUTER  CENTRE
C presentation! BATRA COMPUTER CENTRE
 

More from valarpink

Technology Based Learning
Technology Based LearningTechnology Based Learning
Technology Based Learning
valarpink
 
Science routines
Science routinesScience routines
Science routines
valarpink
 
Welcome
WelcomeWelcome
Welcome
valarpink
 
To Test
To TestTo Test
To Test
valarpink
 
Check
CheckCheck
Check
valarpink
 
Check
CheckCheck
Check
valarpink
 
Year plan
Year planYear plan
Year plan
valarpink
 
Web2 tools
Web2 toolsWeb2 tools
Web2 tools
valarpink
 
DEVELOPMENT OF TEACHING LEARNING MATERIALS
DEVELOPMENT OF TEACHING LEARNING MATERIALSDEVELOPMENT OF TEACHING LEARNING MATERIALS
DEVELOPMENT OF TEACHING LEARNING MATERIALS
valarpink
 
Peace Education
Peace EducationPeace Education
Peace Education
valarpink
 
Life skill humour
Life skill humourLife skill humour
Life skill humour
valarpink
 
Maladjustment
MaladjustmentMaladjustment
Maladjustment
valarpink
 
Guidance and Counselling
Guidance and CounsellingGuidance and Counselling
Guidance and Counselling
valarpink
 
Curriculum Change, Planning and Transaction
Curriculum Change, Planning and TransactionCurriculum Change, Planning and Transaction
Curriculum Change, Planning and Transaction
valarpink
 
Curriculum Evaluation
Curriculum EvaluationCurriculum Evaluation
Curriculum Evaluation
valarpink
 
Innovations in Teaching and Learning Process
Innovations in Teaching and Learning ProcessInnovations in Teaching and Learning Process
Innovations in Teaching and Learning Process
valarpink
 
Class
ClassClass
Class
valarpink
 
Bases of curriculum
Bases of curriculumBases of curriculum
Bases of curriculum
valarpink
 
Curriculum its meaning, nature and scope
Curriculum   its meaning, nature and scopeCurriculum   its meaning, nature and scope
Curriculum its meaning, nature and scope
valarpink
 
Computer Literacy and Awareness in Schools
Computer Literacy and Awareness in SchoolsComputer Literacy and Awareness in Schools
Computer Literacy and Awareness in Schools
valarpink
 

More from valarpink (20)

Technology Based Learning
Technology Based LearningTechnology Based Learning
Technology Based Learning
 
Science routines
Science routinesScience routines
Science routines
 
Welcome
WelcomeWelcome
Welcome
 
To Test
To TestTo Test
To Test
 
Check
CheckCheck
Check
 
Check
CheckCheck
Check
 
Year plan
Year planYear plan
Year plan
 
Web2 tools
Web2 toolsWeb2 tools
Web2 tools
 
DEVELOPMENT OF TEACHING LEARNING MATERIALS
DEVELOPMENT OF TEACHING LEARNING MATERIALSDEVELOPMENT OF TEACHING LEARNING MATERIALS
DEVELOPMENT OF TEACHING LEARNING MATERIALS
 
Peace Education
Peace EducationPeace Education
Peace Education
 
Life skill humour
Life skill humourLife skill humour
Life skill humour
 
Maladjustment
MaladjustmentMaladjustment
Maladjustment
 
Guidance and Counselling
Guidance and CounsellingGuidance and Counselling
Guidance and Counselling
 
Curriculum Change, Planning and Transaction
Curriculum Change, Planning and TransactionCurriculum Change, Planning and Transaction
Curriculum Change, Planning and Transaction
 
Curriculum Evaluation
Curriculum EvaluationCurriculum Evaluation
Curriculum Evaluation
 
Innovations in Teaching and Learning Process
Innovations in Teaching and Learning ProcessInnovations in Teaching and Learning Process
Innovations in Teaching and Learning Process
 
Class
ClassClass
Class
 
Bases of curriculum
Bases of curriculumBases of curriculum
Bases of curriculum
 
Curriculum its meaning, nature and scope
Curriculum   its meaning, nature and scopeCurriculum   its meaning, nature and scope
Curriculum its meaning, nature and scope
 
Computer Literacy and Awareness in Schools
Computer Literacy and Awareness in SchoolsComputer Literacy and Awareness in Schools
Computer Literacy and Awareness in Schools
 

Recently uploaded

How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 

Recently uploaded (20)

How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 

Problem Solving Techniques

  • 1.  FLOW CHARTS  PSEUDO CODE
  • 2.  They are very precise. They represent our thoughts exactly.
  • 3. FUNDAMENTAL CONDITIONAL AND CONTROL STRUCTURES: Branching: Two way branching: Eg: if A > B, then Print A, otherwise Print B Multiway branching: Eg: if n is 0, then Print ‘ zero’ 1, then Print ‘ one’ 2, then Print ‘ two’ 3, then Print ‘ three’
  • 4. ITERATION: The third fundamental technique is Iteration. It means repeating a set of actions again and again.
  • 5.  Pseudo code can be used to represent a procedure for doing something.  These are in between the English and the high level computer languages. The flow chart fundamental control structures for branching and iteration correspond to the following pseudo code.  if…then…else  if…then  For…to…do…  While…do…
  • 6.
  • 7.
  • 8. Consider the statement: number = number + 1; The tokens are, number - identifer (variable) = - operator + - operator 1 - constant ; - punctuation
  • 9. A constant is of numeric or non-numeric type. It can be a number, a character or a character string that can be used as a value in a program.  Numeric constants are of three types: • integer constant • floating-point constant • character constant  A non-numeric data can be called as a literal. String Literal: A string literal or a string constant is a sequence of characters from the system’s character set, enclosed in double quotes.
  • 10.  Integer Constant: An integer constant is a decimal number (base 10) that represents an integral value (the whole number). It comprises of the digits 0 to 9.  Floating - point Constant A floating-point constant is a signed real number. It includes integer portion, a decimal point, fractional portion and an exponent. Eg. 5.864E1  Character Constant A character is a letter, numeral or special symbol, which can be handled by the computer system. These available symbols define the system’s character set. Eg. ‘1’, ‘a’, ‘+’, and ‘-‘ are the valid character constants.
  • 11.  Identifiers are the names that are to be given to the variables, functions, data types and labels in a program.  The name of a variable can consist of alphabets (letters) and numbers.  Other characters are not allowed in the name of a variable except an underscore character.  The variable name starts with an alphabet and its length may vary from one character to 32 characters.  The first character in a variable’s name should be an alphabet,  Keywords (which have special meaning in C) cannot be used as identifiers The valid variable names are:  x  length  x_value  y_value  A123
  • 12. POINTER VARIABLES The variables in C are classified into ordinary variables and pointer variables. int x; x = 10; int *y; A pointer variable assumes only address as its value. Each variable takes some locations in the main memory according to its type. Every location in the main memory is addressable. y=&x; • y represents the address of the variable x (&x) • *y represents the value of the variable x (x)
  • 14. Variable = Expression; i++ postfix form ++i prefix form c = a+b; arithmetic expression c = a > b; relational expression f = d = e; assignment expression x = i++; /*postfix increment expression on the right side*/ printf() scanf()
  • 15.  [ ] - represent array index  { } - cover the body of the function  ( ) - represent a function, to group items  < > - enclose a header file in a preprocessor statement  “ “ - represent string literals  ‘ ‘ - represent a character constant  /* */ - represent a comment  ; - a statement terminator  , - to separate items KEYWORDS They cannot be used as identifiers for the variables in a program. auto break case char continue default do else if float for int return static switch while A keyword must be specified precisely as given in the list.
  • 16.
  • 17.  Each and every line of a C program can be considered as a statement. There are generally four types of statements. They are:  • Preprocessor statement  • Function header statement  • Declaration statement  • Executable statement #include <stdio.h> => Preprocessor Statement main() => Function header Statement { int a,b,c; => Variable declaration statement int add(int,int); => Function declaration statement a = 10; => Executable statement }
  • 18. PRINTF() STATEMENT: PRINTF( FORMATTING STRING, CONTROL STRING) printf(“%d”, n); Formatting character Data type %d int %f float %c char %s char [ ] %ld long int %lf long float or double control string of printf() function are: ‘n’ - new line character ‘t’ - tab character ‘b’ - backspace character Eg: printf(“the value of i = %d n”, i);
  • 19.  To read a value from the keyboard (standard input), the function scanf() is used.  The prototype of scanf() is similar to the prototype of printf(). int x; scanf(“%d”, &x); • The second parameter of the above scanf() function is &x, which represents the address of x. • & is the address of operator and when it is being used with a variable, it provides the address of that variable.
  • 20.  The user or programmer can write functions to define specific tasks that may be used at many points in a program.  The function which calls another function is termed as calling function and the other is termed as called function.  A function declaration may be called as a function prototype or a function model. The function prototype has four components. • Name of the function • Return value type • Number of parameters • Type of each parameter
  • 23. if • if(relational expression) • statement1 if..else • if(relational expression) • statement1; • else • statement2; switchcase • switch(cond.expr.) • { • case1 expr1: • .... • break; • case2 expr2: • .... • break; • default: • }
  • 24. while do...while for • Initialization while(condition) { ……..; processing stmts …….; increment } for(initialization; condition; increment) { body of the loop; } do { …….; } while(condition);
  • 25.  DEFINITION: An array is a collection of homogeneous elements i.e. elements of similar data type.  EXAMPLE: int a[100];  DECLARATION STMT: int a[10]; /* => array declaration statement */ a[0]=6; a[1]= 7; …..a[99]=67;
  • 26. A multidimensional array has been considered as an array of arrays in C language DECLARATION int a[3][3]; a[0] =[ 1 2 3 ] a[1] =[ 4 5 6 ] a[2] =[ 7 8 9 ]
  • 27.  Structures are derived data types in C language.  Structures are used to create user-defined types. Structures are commonly used to define records to be stored in files.  A file is a collection of records.  A record is a collection of fields of information.
  • 28.  Roll number: an integer field  Name: an array of characters  age: an integer field  Consider the following structure definition: Eg: struct student { int rollno; char name[24]; init age; } x, y;
  • 29. Accessing the members of the Structures: x.rollno = 1000; y.rollno = 1001; Pointers to Structures: struct student *ptr; struct student s1; ptr = &s1; An Array of Structures: struct student x[5]; x[0].rollno, x[0].name, uctures