SlideShare a Scribd company logo
General Programming Concepts
Presented by Codeblix
Some Basic Terms
Algorithm
Algorithm / Flowchart
– A step-by-step procedure for solving a particul step procedure for
solving a particular problem. ar problem.
– Independent of the programming language.
Program
– A translation of the algorithm/flowchart into a form that can be
processed by a computer.
– Typically written in a high Typically written in a high-level language
like C, level language like C, C++, Java, etc
Variables and Constants
Variables and Constants
-All temporary results are stored in terms of variables
– The value of a variable can be changed.
– The value of a constant do not change.
Where are they stored?
– In main memory
Program
– A translation of the algorithm/flowchart into a form that can be
processed by a computer.
– Typically written in a high Typically written in a high-level language
like C, level language like C, C++, Java, etc
10 ?
y=20
10 20
x=y/4
5 20
y=x+2
5 7
X YInstructions
Three Common types of Data Type
-Integer :: can store only whole numbers
Examples: 25, -56, 1, 0
-Floating Floating-point :: can store numbers with fractional values.
Examples: 12345.345 , 5.0, 3.14159
– Character :: can store a character
Examples: ‘A’, ‘a’, ‘*’, ‘3’, ‘ ’, ‘+’
How are these Data Types stored in
Memory ?
– Integer ::
16 bits
32 bits
– Float ::
32 bits
64 bits
– Char ::
8 bits (ASCII code) 16 bits (UNICODE,
used in Java)
NOTE:
Actual number of bits vary from one
computer to another
Draw flowchart or write algorithm
Specify the problem to be solved
Execute the program
Convert flowchart (algorithm) into program code
Compile the program into object
code.
Problem Solving Technique
Adding three numbers
START
READ A, B, C
Sum= A+B+C
OUTPUT Sum
END
Larger Of two Numbers
START
READ X, Y
IS
X>Y?
YES NO
OUTPUT X OUTPUT Y
END END
Largest Of Three Numbers
START
READ X, Y, Z
IS
X>Y?
YES NO
MAX = X MAX = Y
IS
MAX>Z
?
YES NO
OUTPUT
MAX
OUTPUT
Z
END END
Sum Of First N Natural Numbers
START
READ N
SUM = 0
COUNT = 1
SUM = SUM + COUNT
COUNT = COUNT + 1
IS
COUNT >
N?
OUTPUT
SUM
END
NO YES
Sum = 12 + 22 + 32 + 42 + N2
START
READ N
SUM = 0
COUNT = 1
SUM = SUM + COUNT * COUNT
COUNT = COUNT + 1
IS COUNT
> N?
OUTPUT
SUM
END
NO YES
Sum = 1.2 + 2.3 + 3.4 + to N terms.
START
READ N
SUM = 0
COUNT = 1
SUM = SUM + COUNT * (COUNT + 1)
COUNT = COUNT + 1
IS COUNT
> N?
OUTPUT
SUM
END
NO YES
Computing Factorial
START
READ N
PROD = 1
COUNT = 1
PROD = PROD * COUNT
COUNT = COUNT + 1
IS COUNT
> N?
OUTPUT
PROD
END
NO YES
Computing ex series up to N
terms START
READ X, N
TERM = 1
SUM = 0
COUNT = 1
SUM = SUM + TERM
TERM = TERM * X/ COUNT
COUNT = COUNT + 1
IS COUNT
> N?
OUTPUT SUM
END
NO YES
Computing ex series upto 4 decimal places
START
READ X, N
TERM = 1
SUM = 0
COUNT = 1
SUM = SUM + TERM
TERM = TERM * X/ COUNT
COUNT = COUNT + 1
IS TERM <
0.0001 ?
OUTPUT SUM
END
NO YES
Roots of Quadratic Equation
ax2 + bx + c = 0
TRY YOURSELF
Grade Computation
MARKS ≥ 90
Ex
89 ≥ MARKS ≥ 80 A
79 ≥ MARKS ≥ 60 B
69 ≥ MARKS ≥ 60 C
59 ≥ MARKS ≥ 50 P
49 ≥ MARKS ≥ 35 F
Grade Computation ( Contd.)
START
READ MARKS
MARKS
≥ 90?
MARKS
≥ 80?
MARKS
≥ 70?
NO NO NO
OUTPUT
“Ex”
OUTPUT
“B”
OUTPUT
“A”
END END END
YES YES YES
CONTD.
MARK
S ≥ 60?
MARK
S ≥ 50?
MARK
S ≥ 35?
NO NO
OUTPUT
“C”
OUTPUT
“P”
OUTPUT
“D”
END END END
OUTPUT
“F”
END
NO
YES YES YES
CONTD.

More Related Content

Similar to Basic pogramming concepts

lec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.pptlec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.ppt
SourabhPal46
 
Programming
ProgrammingProgramming
Programming
Sean Chia
 
Chapter one
Chapter oneChapter one
Chapter one
mihiretu kassaye
 
DAA-Unit1.pptx
DAA-Unit1.pptxDAA-Unit1.pptx
DAA-Unit1.pptx
NishaS88
 
Computer Programming Computer Programming
Computer Programming Computer ProgrammingComputer Programming Computer Programming
Computer Programming Computer Programming
arifhasan88
 
Workshop03.docx lap trinh C cho người mới bắt đầu
Workshop03.docx  lap trinh C cho người mới bắt đầuWorkshop03.docx  lap trinh C cho người mới bắt đầu
Workshop03.docx lap trinh C cho người mới bắt đầu
linhtran111111111111
 
Lecture1
Lecture1Lecture1
Lecture1
Andrew Raj
 
8.1 alogorithm & prolem solving
8.1 alogorithm & prolem solving8.1 alogorithm & prolem solving
8.1 alogorithm & prolem solving
Khan Yousafzai
 
Software Metrics
Software MetricsSoftware Metrics
Software Metrics
Ehsan Hessami
 
Logic Development and Algorithm.
Logic Development and Algorithm.Logic Development and Algorithm.
Logic Development and Algorithm.
NandiniSidana
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
Samuel Igbanogu
 
Introduction to design and analysis of algorithm
Introduction to design and analysis of algorithmIntroduction to design and analysis of algorithm
Introduction to design and analysis of algorithm
DevaKumari Vijay
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
khair20
 
ICT_Seminar_flow_charts_for_2013_Nov.pptx
ICT_Seminar_flow_charts_for_2013_Nov.pptxICT_Seminar_flow_charts_for_2013_Nov.pptx
ICT_Seminar_flow_charts_for_2013_Nov.pptx
ssuser2f67c91
 
Programming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptxProgramming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptx
SONU KUMAR
 
Introduction to computer science
Introduction to computer scienceIntroduction to computer science
Introduction to computer science
umardanjumamaiwada
 
lecture 5
 lecture 5 lecture 5
lecture 5
umardanjumamaiwada
 
ALGORITHM PPT GUIDE.pdf
ALGORITHM PPT GUIDE.pdfALGORITHM PPT GUIDE.pdf
ALGORITHM PPT GUIDE.pdf
meychu1
 
Data structures Lecture no. 4
Data structures Lecture no. 4Data structures Lecture no. 4
Data structures Lecture no. 4
AzharIqbal710687
 
Problem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study materialProblem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study material
To Sum It Up
 

Similar to Basic pogramming concepts (20)

lec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.pptlec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.ppt
 
Programming
ProgrammingProgramming
Programming
 
Chapter one
Chapter oneChapter one
Chapter one
 
DAA-Unit1.pptx
DAA-Unit1.pptxDAA-Unit1.pptx
DAA-Unit1.pptx
 
Computer Programming Computer Programming
Computer Programming Computer ProgrammingComputer Programming Computer Programming
Computer Programming Computer Programming
 
Workshop03.docx lap trinh C cho người mới bắt đầu
Workshop03.docx  lap trinh C cho người mới bắt đầuWorkshop03.docx  lap trinh C cho người mới bắt đầu
Workshop03.docx lap trinh C cho người mới bắt đầu
 
Lecture1
Lecture1Lecture1
Lecture1
 
8.1 alogorithm & prolem solving
8.1 alogorithm & prolem solving8.1 alogorithm & prolem solving
8.1 alogorithm & prolem solving
 
Software Metrics
Software MetricsSoftware Metrics
Software Metrics
 
Logic Development and Algorithm.
Logic Development and Algorithm.Logic Development and Algorithm.
Logic Development and Algorithm.
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
 
Introduction to design and analysis of algorithm
Introduction to design and analysis of algorithmIntroduction to design and analysis of algorithm
Introduction to design and analysis of algorithm
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
 
ICT_Seminar_flow_charts_for_2013_Nov.pptx
ICT_Seminar_flow_charts_for_2013_Nov.pptxICT_Seminar_flow_charts_for_2013_Nov.pptx
ICT_Seminar_flow_charts_for_2013_Nov.pptx
 
Programming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptxProgramming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptx
 
Introduction to computer science
Introduction to computer scienceIntroduction to computer science
Introduction to computer science
 
lecture 5
 lecture 5 lecture 5
lecture 5
 
ALGORITHM PPT GUIDE.pdf
ALGORITHM PPT GUIDE.pdfALGORITHM PPT GUIDE.pdf
ALGORITHM PPT GUIDE.pdf
 
Data structures Lecture no. 4
Data structures Lecture no. 4Data structures Lecture no. 4
Data structures Lecture no. 4
 
Problem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study materialProblem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study material
 

Recently uploaded

Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
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
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
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
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
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
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
S. Raj Kumar
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
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
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
imrankhan141184
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
EduSkills OECD
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
TechSoup
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
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)
 

Recently uploaded (20)

Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
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
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
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
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
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
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
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” .
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
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...
 

Basic pogramming concepts

  • 3. Algorithm Algorithm / Flowchart – A step-by-step procedure for solving a particul step procedure for solving a particular problem. ar problem. – Independent of the programming language.
  • 4. Program – A translation of the algorithm/flowchart into a form that can be processed by a computer. – Typically written in a high Typically written in a high-level language like C, level language like C, C++, Java, etc
  • 6. Variables and Constants -All temporary results are stored in terms of variables – The value of a variable can be changed. – The value of a constant do not change. Where are they stored? – In main memory
  • 7. Program – A translation of the algorithm/flowchart into a form that can be processed by a computer. – Typically written in a high Typically written in a high-level language like C, level language like C, C++, Java, etc
  • 8. 10 ? y=20 10 20 x=y/4 5 20 y=x+2 5 7 X YInstructions
  • 9. Three Common types of Data Type -Integer :: can store only whole numbers Examples: 25, -56, 1, 0 -Floating Floating-point :: can store numbers with fractional values. Examples: 12345.345 , 5.0, 3.14159 – Character :: can store a character Examples: ‘A’, ‘a’, ‘*’, ‘3’, ‘ ’, ‘+’
  • 10. How are these Data Types stored in Memory ? – Integer :: 16 bits 32 bits – Float :: 32 bits 64 bits – Char :: 8 bits (ASCII code) 16 bits (UNICODE, used in Java) NOTE: Actual number of bits vary from one computer to another
  • 11. Draw flowchart or write algorithm Specify the problem to be solved Execute the program Convert flowchart (algorithm) into program code Compile the program into object code. Problem Solving Technique
  • 12. Adding three numbers START READ A, B, C Sum= A+B+C OUTPUT Sum END
  • 13. Larger Of two Numbers START READ X, Y IS X>Y? YES NO OUTPUT X OUTPUT Y END END
  • 14. Largest Of Three Numbers START READ X, Y, Z IS X>Y? YES NO MAX = X MAX = Y IS MAX>Z ? YES NO OUTPUT MAX OUTPUT Z END END
  • 15. Sum Of First N Natural Numbers START READ N SUM = 0 COUNT = 1 SUM = SUM + COUNT COUNT = COUNT + 1 IS COUNT > N? OUTPUT SUM END NO YES
  • 16. Sum = 12 + 22 + 32 + 42 + N2 START READ N SUM = 0 COUNT = 1 SUM = SUM + COUNT * COUNT COUNT = COUNT + 1 IS COUNT > N? OUTPUT SUM END NO YES
  • 17. Sum = 1.2 + 2.3 + 3.4 + to N terms. START READ N SUM = 0 COUNT = 1 SUM = SUM + COUNT * (COUNT + 1) COUNT = COUNT + 1 IS COUNT > N? OUTPUT SUM END NO YES
  • 18. Computing Factorial START READ N PROD = 1 COUNT = 1 PROD = PROD * COUNT COUNT = COUNT + 1 IS COUNT > N? OUTPUT PROD END NO YES
  • 19. Computing ex series up to N terms START READ X, N TERM = 1 SUM = 0 COUNT = 1 SUM = SUM + TERM TERM = TERM * X/ COUNT COUNT = COUNT + 1 IS COUNT > N? OUTPUT SUM END NO YES
  • 20. Computing ex series upto 4 decimal places START READ X, N TERM = 1 SUM = 0 COUNT = 1 SUM = SUM + TERM TERM = TERM * X/ COUNT COUNT = COUNT + 1 IS TERM < 0.0001 ? OUTPUT SUM END NO YES
  • 21. Roots of Quadratic Equation ax2 + bx + c = 0 TRY YOURSELF
  • 22. Grade Computation MARKS ≥ 90 Ex 89 ≥ MARKS ≥ 80 A 79 ≥ MARKS ≥ 60 B 69 ≥ MARKS ≥ 60 C 59 ≥ MARKS ≥ 50 P 49 ≥ MARKS ≥ 35 F
  • 23. Grade Computation ( Contd.) START READ MARKS MARKS ≥ 90? MARKS ≥ 80? MARKS ≥ 70? NO NO NO OUTPUT “Ex” OUTPUT “B” OUTPUT “A” END END END YES YES YES CONTD.
  • 24. MARK S ≥ 60? MARK S ≥ 50? MARK S ≥ 35? NO NO OUTPUT “C” OUTPUT “P” OUTPUT “D” END END END OUTPUT “F” END NO YES YES YES CONTD.