SlideShare a Scribd company logo
1 of 9
Programming Errors/ Bugs
 Bug
 Debugging
 Types of Programming Errors / Bugs
 Syntax Errors
 Run-time Errors
 Logical Errors
@YouTube: Learn to Lead Computer Science
Unexpected output produced by program.
Debugging
The process of finding and removing errors.
(Found by Developer) (Found by tester)
Error Bug
https://www.youtube.com/channel/UCUhiAuU6nPhGSONtVAa6HMQ
Types of Errors/ Bugs
Invalid
statement
written in code
Error in
execution of
successful
compilation of
code
Poor logics in
Code
Syntax
errors
Syntax
errors
Run
Time
errors
Logical
errors
https://www.youtube.com/channel/UCUhiAuU6n
PhGSONtVAa6HMQ
Syntax of Programming Language
 Set of rules of a programming language for writing
statements of a computer program.
Syntax Errors:
 Occur due to violation of Syntax
(Grammar Rules) of programming language
 Detected before compile time
 Easy to detect and modify
 Program does not execute before correction
https://www.youtube.com/channel/UCUhiAuU6nPhGSO
NtVAa6HMQ
Common Syntax Errors
Most frequently occurring syntax errors include:
 Missing or misplaced Semicolon “;”
 Spelling Mistake
 Missing or extra parenthesis or braces
 Incorrect use of operators, loops or blocks etc
#include<stdio.h>
int main()
{
int length = 5;
int width = 10 Missing Semicolon “;”
int area = length * width + ;
printtf(“Test”);
printf("The area of the rectangle is %dn", area);
return 0;
}
}
Spelling
mistake
Extra brace
Incorrect use of operator
https://www.youtube.com/channel/UCUhiAuU6nPhGSONtVA
a6HMQ
RUN TIME ERROR
 Occur due to performing illegal operations (Divide a
number by zero)
 Occur during program execution (Run time).
 These errors are not hardest to find
 It leads to abnormal termination of the program
 When run time errors occur, the compiler stops the
execution of program and displays error message
https://www.youtube.com/channel/UCUhiAuU6nPhG
SONtVAa6HMQ
Common Run-Time errors
 Dividing a number by zero.
 If input data given to program is not in correct format
or input data file is not found in specified path
#include<stdio.h>
int main()
{
int no = 9, div =0; //Error: number is divided by zero 0,
div = no/0;
printf("The result is %dn", div);
return 0;
}
https://www.youtube.com/channel/UCUhiAuU6n
PhGSONtVAa6HMQ
Logical Errors
 The errors in logic of program are called logical errors.
 These errors are not detected by compiler
 These errors are hardest to find and remove because
 Compiler does not detect these errors
 There is not identification (error message) during
program execution.
https://www.youtube.com/channel/UCUhiAuU6n
PhGSONtVAa6HMQ
Common Logical Errors
Write a program in c language to show the sum of two numbers.
#include<stdio.h>
int main()
{
int a,b,sum;
sum = a-b;
printf("The sum of a and b is %dn", sum);
return 0;
}
This program always produce wrong result because
requirement is sum not subtraction
https://www.youtube.com/channel/UCUhiAuU6n
PhGSONtVAa6HMQ

More Related Content

Similar to Programming Error or Bug.pptx

Passing The Joel Test In The PHP World
Passing The Joel Test In The PHP WorldPassing The Joel Test In The PHP World
Passing The Joel Test In The PHP World
Lorna Mitchell
 
C and its errors
C and its errorsC and its errors
C and its errors
Junaid Raja
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer Programming
Prof. Erwin Globio
 
programming type error
programming type errorprogramming type error
programming type error
Walepak Ubi
 
Lewis brady engine terminology (edited version)
Lewis brady engine terminology (edited version)Lewis brady engine terminology (edited version)
Lewis brady engine terminology (edited version)
LewisB2013
 

Similar to Programming Error or Bug.pptx (20)

Passing The Joel Test In The PHP World
Passing The Joel Test In The PHP WorldPassing The Joel Test In The PHP World
Passing The Joel Test In The PHP World
 
TYPES OF ERRORS.pptx
TYPES OF ERRORS.pptxTYPES OF ERRORS.pptx
TYPES OF ERRORS.pptx
 
C and its errors
C and its errorsC and its errors
C and its errors
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer Programming
 
Software Bugs A Software Architect Point Of View
Software Bugs    A Software Architect Point Of ViewSoftware Bugs    A Software Architect Point Of View
Software Bugs A Software Architect Point Of View
 
Error Correction Techniques
Error Correction TechniquesError Correction Techniques
Error Correction Techniques
 
Project
ProjectProject
Project
 
The Death of Flaky Tests by Dave Haeffner
The Death of Flaky Tests by Dave HaeffnerThe Death of Flaky Tests by Dave Haeffner
The Death of Flaky Tests by Dave Haeffner
 
Notacd081
Notacd081Notacd081
Notacd081
 
Live Source - an Agile Toolkit
Live Source - an Agile ToolkitLive Source - an Agile Toolkit
Live Source - an Agile Toolkit
 
programming type error
programming type errorprogramming type error
programming type error
 
Notacd08
Notacd08Notacd08
Notacd08
 
Session17-Software Testing.pdf
Session17-Software Testing.pdfSession17-Software Testing.pdf
Session17-Software Testing.pdf
 
Steps in Implementing a Program.ppsx
Steps in Implementing a Program.ppsxSteps in Implementing a Program.ppsx
Steps in Implementing a Program.ppsx
 
SD & D Testing
SD & D TestingSD & D Testing
SD & D Testing
 
Module 1 2 just basic-
Module 1 2  just basic-Module 1 2  just basic-
Module 1 2 just basic-
 
Module 201 2 20 just 20 basic
Module 201   2  20  just 20 basic Module 201   2  20  just 20 basic
Module 201 2 20 just 20 basic
 
Programming part2
Programming part2Programming part2
Programming part2
 
Lewis brady engine terminology (edited version)
Lewis brady engine terminology (edited version)Lewis brady engine terminology (edited version)
Lewis brady engine terminology (edited version)
 
Big Java Chapter 1
Big Java Chapter 1Big Java Chapter 1
Big Java Chapter 1
 

Recently uploaded

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Recently uploaded (20)

INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 

Programming Error or Bug.pptx

  • 1. Programming Errors/ Bugs  Bug  Debugging  Types of Programming Errors / Bugs  Syntax Errors  Run-time Errors  Logical Errors @YouTube: Learn to Lead Computer Science
  • 2. Unexpected output produced by program. Debugging The process of finding and removing errors. (Found by Developer) (Found by tester) Error Bug https://www.youtube.com/channel/UCUhiAuU6nPhGSONtVAa6HMQ
  • 3. Types of Errors/ Bugs Invalid statement written in code Error in execution of successful compilation of code Poor logics in Code Syntax errors Syntax errors Run Time errors Logical errors https://www.youtube.com/channel/UCUhiAuU6n PhGSONtVAa6HMQ
  • 4. Syntax of Programming Language  Set of rules of a programming language for writing statements of a computer program. Syntax Errors:  Occur due to violation of Syntax (Grammar Rules) of programming language  Detected before compile time  Easy to detect and modify  Program does not execute before correction https://www.youtube.com/channel/UCUhiAuU6nPhGSO NtVAa6HMQ
  • 5. Common Syntax Errors Most frequently occurring syntax errors include:  Missing or misplaced Semicolon “;”  Spelling Mistake  Missing or extra parenthesis or braces  Incorrect use of operators, loops or blocks etc #include<stdio.h> int main() { int length = 5; int width = 10 Missing Semicolon “;” int area = length * width + ; printtf(“Test”); printf("The area of the rectangle is %dn", area); return 0; } } Spelling mistake Extra brace Incorrect use of operator https://www.youtube.com/channel/UCUhiAuU6nPhGSONtVA a6HMQ
  • 6. RUN TIME ERROR  Occur due to performing illegal operations (Divide a number by zero)  Occur during program execution (Run time).  These errors are not hardest to find  It leads to abnormal termination of the program  When run time errors occur, the compiler stops the execution of program and displays error message https://www.youtube.com/channel/UCUhiAuU6nPhG SONtVAa6HMQ
  • 7. Common Run-Time errors  Dividing a number by zero.  If input data given to program is not in correct format or input data file is not found in specified path #include<stdio.h> int main() { int no = 9, div =0; //Error: number is divided by zero 0, div = no/0; printf("The result is %dn", div); return 0; } https://www.youtube.com/channel/UCUhiAuU6n PhGSONtVAa6HMQ
  • 8. Logical Errors  The errors in logic of program are called logical errors.  These errors are not detected by compiler  These errors are hardest to find and remove because  Compiler does not detect these errors  There is not identification (error message) during program execution. https://www.youtube.com/channel/UCUhiAuU6n PhGSONtVAa6HMQ
  • 9. Common Logical Errors Write a program in c language to show the sum of two numbers. #include<stdio.h> int main() { int a,b,sum; sum = a-b; printf("The sum of a and b is %dn", sum); return 0; } This program always produce wrong result because requirement is sum not subtraction https://www.youtube.com/channel/UCUhiAuU6n PhGSONtVAa6HMQ