Monday, 21 May 2012

Types of Errors

                 There are three types of errors that may occur while developing or writing C program. There errors are:

  1. Syntax Errors
  2. Logical Errors
  3. Runtime Errors

  • Syntax Errors:-

                    The set of rules (grammatical rules) of a programming language for writing statements of the computer program is known as syntax of the language. The program statements are written strictly according to these rules.
                    Syntax error occur when syntax of a programming language are not followed in writing the source code. The compiler detects these errors at compiling time of source code. The compiler reports a proper error message about the error.
                    The compiler does not compile a program that contain syntax errors. The syntax errors are easy to detect and remove.
    In C program, there can be many causes of syntax errors. Some examples are given below:-

  • Missing semicolon ( ; ) at the end of statement.
  • Missing any of delimiters  i.e { or }
  • Incorrect spelling of any keyword.
  • Using variable without declaration etc.



  • Logical Errors:-
                                                            
                   The errors in the logic of the program are called logical error. The compiler cannot detect logical errors. A program with logical errors is compiled (translated) and run successfully but it does not give correct result.


  • The sequence of instructions used in a program may be incorrect.
  • The mathematical formulas used in program instructions may be incorrect etc.
The logical errors are difficult to detect. Logical errors can only be detected by examining all the units of the program one by one. It is a very time consuming and lengthy process.

  • Runtime Errors:-


 
                     The errors that occur during the execution of program are called the runtime errors. These types of errors may occur due to the following reasons.
  • When the program attempts to perform an illegal operation such as dividing a number by zero.
  • If input data given to the program is not in a correct format or input data file is not found in the specified path.
  • If hardware problem occurs such as hard disk error, or disk full or printer error etc.
When a runtime error occurs, the computer stops the execution of program and displays an error message.

32 comments:

  1. I really appreciate the kind of topics you post here. Thanks for sharing information that is actually helpful. Good day! http://scarprin.ws/

    ReplyDelete
  2. Good job! I have found many articles to read but you do a good thing. That is a boy. Thank you so much for sharing the delicious post. Expect your next article.
    http://www.fadeplex.com

    ReplyDelete
  3. Gloriously expert position. I merely bumbled upon your post and desired to articulate that I have really relished understanding your blog articles.
    sell house as is

    ReplyDelete
  4. I realise this is off topic but while your blog looks nice it would be far better if you'll be able to use lighter colors too in the design. This will encourage a lot more readers come to check it out more often!
    sell house san Antonio

    ReplyDelete
  5. I think I will become a great follower.Just want to say your article is striking. The clarity in your post is simply striking and i can take for granted you are an expert on this subject.
    best weight loss supplements

    ReplyDelete
  6. Thanks a lot for this article.

    ReplyDelete
  7. This infomation so useful for the people who are all started learning C..
    Thanks for such good article..

    To learn best exposure on C and C++..

    Please visit

    C++ Training in Chennai
    C Training in Chennai

    ReplyDelete
  8. This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.
    Java training in Chennai | Java training institute in Chennai | Java course in Chennai

    Java training in Bangalore | Java training in Electronic city

    Java training in Bangalore | Java training in Marathahalli

    Java training in Bangalore | Java training in Btm layout

    ReplyDelete
  9. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
    python training in chennai
    python course institute in chennai

    ReplyDelete
  10. Inspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you..Keep update more information..
    angularjs Training in chennai

    angularjs-Training in tambaram

    angularjs-Training in sholinganallur

    angularjs-Training in velachery

    angularjs-Training in pune

    angularjs Training in bangalore

    ReplyDelete
  11. Some us know all relating to the compelling medium you present powerful steps on this blog and therefore strongly encourage
    contribution from other ones on this subject while our own child is truly discovering a great deal.
    Have fun with the remaining portion of the year.

    Selenium training in bangalore | best selenium training in bangalore | advanced selenium training in bangalore | no.1 selenium training in bangalore

    ReplyDelete
  12. Nice Post! Thank you for sharing very good post, it was so Nice to read and useful to improve my knowledge as updated one, keep blogging.
    Angular js Training in Electronic City

    ReplyDelete
  13. I have to voice my passion for your kindness giving support to those people that should have guidance on this important matter.
    MCSE Training in chennai | mcse training class chennai


    ReplyDelete
  14. It’s great to come across a blog every once in a while that isn’t the same out of date rehashed material. Fantastic read.
    machine learning training in chennai
    java training in chennai

    ReplyDelete
  15. Thanks for sharing this Information. The information you Provided is much useful.

    Get Software Testing Training in Bangalore from Real Time Industry Experts with 100% Placement Assistance in MNC Companies. Book your Free Demo with eTechno Soft Solutions.

    ReplyDelete
  16. Thanks for your post. This is excellent information. The list of your blogs is very helpful for those who want to learn, AWS training in chennai | AWS training in anna nagar | AWS training in omr | AWS training in porur | AWS training in tambaram | AWS training in velachery

    ReplyDelete
  17. It is an informative blog. I would like to know more information. Anyway thanks a lot for sharing this post. Those guidelines additionally worked to become a good way to recognize that other people online have the identical fervour like mine to grasp great deal more around this condition.Data Science Training In Chennai

    Data Science Online Training In Chennai

    Data Science Training In Bangalore

    Data Science Training In Hyderabad

    Data Science Training In Coimbatore

    Data Science Training

    Data Science Online Training

    ReplyDelete
  18. Your article got me thinking about something. Who do we contact if we want anesthesia quickly? I have heard there are some mobile services online, and now I know which of these services is best at their job. I am glad my friends told me about them. seo

    ReplyDelete
  19. Thanks for sharing, if you want more benefits then remain connect with us.

    HTML Compiler Crack

    ReplyDelete
  20. Sign up now and participate in our demonstration sessions for Python Course in Hyderabad by AI Patasala and nurture your career with this platform.
    Online Python Training in Hyderabad

    ReplyDelete

  21. it is really explainable very well and i got more information from your blog.

    ReplyDelete