SlideShare a Scribd company logo
1 of 29
 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 JyothiSowmyaJyothi3
 
Ch2 introduction to c
Ch2 introduction to cCh2 introduction to c
Ch2 introduction to cHattori 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 languageRai University
 
Variables in C Programming
Variables in C ProgrammingVariables in C Programming
Variables in C Programmingprogramming9
 
Programming in C Presentation upto FILE
Programming in C Presentation upto FILEProgramming in C Presentation upto FILE
Programming in C Presentation upto FILEDipta 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 languageRai University
 
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 languageRai 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 languageRai University
 
Cpu-fundamental of C
Cpu-fundamental of CCpu-fundamental of C
Cpu-fundamental of CSuchit Patel
 
Introduction to Basic C programming 01
Introduction to Basic C programming 01Introduction to Basic C programming 01
Introduction to Basic C programming 01Wingston
 
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 Programmingprogramming9
 
Variables in C and C++ Language
Variables in C and C++ LanguageVariables in C and C++ Language
Variables in C and C++ LanguageWay2itech
 

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.pptxmadhurij54
 
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_.pptxLikhil181
 
Introduction to c
Introduction to cIntroduction to c
Introduction to cAjeet Kumar
 
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.SivakumarSivakumar R D .
 
Chapter 2: Elementary Programming
Chapter 2: Elementary ProgrammingChapter 2: Elementary Programming
Chapter 2: Elementary ProgrammingEric Chou
 
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 Centrejatin batra
 
C presentation! BATRA COMPUTER CENTRE
C presentation! BATRA  COMPUTER  CENTRE C presentation! BATRA  COMPUTER  CENTRE
C presentation! BATRA COMPUTER CENTRE jatin batra
 
C the basic concepts
C the basic conceptsC the basic concepts
C the basic conceptsAbhinav Vatsa
 
Esoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingEsoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingRasan Samarasinghe
 
Escape Sequences and Variables
Escape Sequences and VariablesEscape Sequences and Variables
Escape Sequences and Variablesyarkhosh
 

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
 
C intro
C introC intro
C intro
 
C
CC
C
 
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
 
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
 
C the basic concepts
C the basic conceptsC the basic concepts
C the basic concepts
 
Esoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingEsoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programming
 
Escape Sequences and Variables
Escape Sequences and VariablesEscape Sequences and Variables
Escape Sequences and Variables
 

More from valarpink

Technology Based Learning
Technology Based LearningTechnology Based Learning
Technology Based Learningvalarpink
 
Science routines
Science routinesScience routines
Science routinesvalarpink
 
DEVELOPMENT OF TEACHING LEARNING MATERIALS
DEVELOPMENT OF TEACHING LEARNING MATERIALSDEVELOPMENT OF TEACHING LEARNING MATERIALS
DEVELOPMENT OF TEACHING LEARNING MATERIALSvalarpink
 
Peace Education
Peace EducationPeace Education
Peace Educationvalarpink
 
Life skill humour
Life skill humourLife skill humour
Life skill humourvalarpink
 
Maladjustment
MaladjustmentMaladjustment
Maladjustmentvalarpink
 
Guidance and Counselling
Guidance and CounsellingGuidance and Counselling
Guidance and Counsellingvalarpink
 
Curriculum Change, Planning and Transaction
Curriculum Change, Planning and TransactionCurriculum Change, Planning and Transaction
Curriculum Change, Planning and Transactionvalarpink
 
Curriculum Evaluation
Curriculum EvaluationCurriculum Evaluation
Curriculum Evaluationvalarpink
 
Innovations in Teaching and Learning Process
Innovations in Teaching and Learning ProcessInnovations in Teaching and Learning Process
Innovations in Teaching and Learning Processvalarpink
 
Bases of curriculum
Bases of curriculumBases of curriculum
Bases of curriculumvalarpink
 
Curriculum its meaning, nature and scope
Curriculum   its meaning, nature and scopeCurriculum   its meaning, nature and scope
Curriculum its meaning, nature and scopevalarpink
 
Computer Literacy and Awareness in Schools
Computer Literacy and Awareness in SchoolsComputer Literacy and Awareness in Schools
Computer Literacy and Awareness in Schoolsvalarpink
 

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

Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 

Recently uploaded (20)

Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 

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