---
title: I get various types of runtime errors. How do I fix this?
description: You may see the following types of errors while solving programming problems:  S. No. Error Description 1 NZEC (Non-zero exit code)  Displayed when a program exits and returns a value other than 0 to
---

[Skip to content](https://help.hackerearth.com/hc/en-us/articles/360007254653-i-get-various-types-of-runtime-errors-how-do-i-fix-this-#main-content)

English

Show submenu for translations

![HE logo.png\]](https://help.hackerearth.com/hs-fs/hubfs/HE%20logo.png?height=40&name=HE%20logo.png)

Open main navigation

Close main navigation

- English
  
  Show submenu for translations

 Hello. How can we help you?

- There are no suggestions because the search field is empty.

1. [Help Center](https://help.hackerearth.com/?hsLang=en)
2. [Campus](https://help.hackerearth.com/campus?hsLang=en)
3. [Candidate FAQs](https://help.hackerearth.com/campus?hsLang=en#candidate-faqs)

# I get various types of runtime errors. How do I fix this?

You may see the following types of errors while solving programming problems: 

| **S. No.** | **Error** | **Description** |
| --- | --- | --- |
| 1 | NZEC (Non-zero exit code)  | Displayed when a program exits and returns a value other than 0 to the shell - In C/C++  - In interpreted languages (for e.g. Python) |
|  2 |  SIGSEGV (Segmentation fault) | A common error that is caused by an out-of-scope array index that is causing a buffer overflow or an incorrectly initialized pointer etc. Generated when a program tries to read or write the data that is outside the memory that is allocated for it or to write memory that can only be read. For example, accessing a \[-1\] in a language which does not support negative indices for an array will throw this error. |
| 3 | SIGFPE (Floating point error) | Usually occurs when you are trying to: - Divide a number by 0 - Calculate the square root of a negative number |
| 4 | SIGABRT (Fatal error) | Raised by the program when: - Judge aborts your program in the middle of execution - Memory is not sufficient |
| 5 | SIGXFSZ (Output is too large) | Raised by the program when there is too much data to print |
| 6 | TLE (Time Limit Exceeded) | Raised by the program when your program is too slow |
| 7 | MLE (Memory Limit Exceeded) | Raised by the program when you try to allocate the memory beyond the indicated limit For example, if you declare a very large array, or if a data structure in your program is too large |
| 8 | RE (Runtime error) | Usually occurs when a program is compiled successfully but ends with an error or crashes |
| 9 | CE (Compilation Error) | Usually occurs when the compiler fails to compile your code due to errors in the code errors in the compiler itself |
| 10 | CV (Problem constraint violation) | Displayed when the program violates at least one of the problem constraints For example, - If you have created too many tables - Inserted too many rows inside a table  |
| 11 | Other errors | Raised by the program when: - You use too much memory - Arrays or other elements are too large to fit in the memory - There is SIGSEGV error |

#### **Runtime errors**

These errors occur when:

- Invalid mathematical operations are executed. For example, when you try to divide a number by zero, calculate the square root of a negative number etc.
- Programs crash because of a segmentation fault. For example, an out-of-scope array index causes a buffer overflow, incorrectly initialized pointers, etc.
- Your program has printed more than the maximum limit of data to the standard output.

*Notes*

- Applicable to programming problems only
- Limited only to the following languages: C, C++, Java, Python, Python 3

### **How are runtime errors displayed?**

Runtime errors are displayed by highlighting these errors in the code editor on your test interface. When a runtime error occurs, you will see next to the line that caused the error in the code editor. When you hover over, they will see a detailed error message.

### **Tips to avoid runtime errors in your code**

- Do not use the variables that have not been initialized. These may be set to 0 on your computer but are not guaranteed to be on the judge.
- Check every single occurrence of accessing an array element and ensure that it is not out of bounds.
- Do not declare too much memory. A memory of 64 MB is guaranteed but having an array of size \[100000\] \[100000\] will not work.
- Do not declare too much stack memory. Large arrays should be declared globally outside the function. Putting an array of 100000 integers inside a function will probably give you an error.

#### **Output errors**

These errors occur when your output has:

- Only one line but the correct output requires more than one line.  
- Non-numeric characters, whereas the correct output requires only numeric characters.
- Negative numbers, whereas the correct output requires only positive numbers.
- Extra empty lines because of printing more new lines '\\\\n' than expected o Intermediate spaces

- [Assessments: Recruiters](https://help.hackerearth.com/assessments-recruiters?hsLang=en#main-content)

    - [Getting started](https://help.hackerearth.com/assessments-recruiters?hsLang=en#getting-started)
    - [Account settings](https://help.hackerearth.com/assessments-recruiters?hsLang=en#account-settings)
    - [Admin management](https://help.hackerearth.com/assessments-recruiters?hsLang=en#admin-management)
    - [Creating tests automatically](https://help.hackerearth.com/assessments-recruiters?hsLang=en#creating-tests-automatically)
    - [Creating tests manually](https://help.hackerearth.com/assessments-recruiters?hsLang=en#creating-tests-manually)
    - [Test settings](https://help.hackerearth.com/assessments-recruiters?hsLang=en#test-settings)
    - [Sections and question pooling](https://help.hackerearth.com/assessments-recruiters?hsLang=en#sections-and-question-pooling)
    - [Libraries](https://help.hackerearth.com/assessments-recruiters?hsLang=en#libraries)
    - [Multiple Choice Questions (MCQs)](https://help.hackerearth.com/assessments-recruiters?hsLang=en#multiple-choice-questions-mcqs)
    - [Programming](https://help.hackerearth.com/assessments-recruiters?hsLang=en#programming)
    - [Project](https://help.hackerearth.com/assessments-recruiters?hsLang=en#project)
    - [SQL](https://help.hackerearth.com/assessments-recruiters?hsLang=en#sql)
    - [Data science](https://help.hackerearth.com/assessments-recruiters?hsLang=en#data-science)
    - [Machine Learning (ML)](https://help.hackerearth.com/assessments-recruiters?hsLang=en#machine-learning-ml)
    - [DevOps](https://help.hackerearth.com/assessments-recruiters?hsLang=en#devops)
    - [Python project questions](https://help.hackerearth.com/assessments-recruiters?hsLang=en#python-project-questions)
    - [Automation Testing](https://help.hackerearth.com/assessments-recruiters?hsLang=en#automation-testing)
    - [Java Project](https://help.hackerearth.com/assessments-recruiters?hsLang=en#java-project)
    - [C# project questions](https://help.hackerearth.com/assessments-recruiters?hsLang=en#c-project-questions)
    - [Subjective](https://help.hackerearth.com/assessments-recruiters?hsLang=en#subjective)
    - [Approximate](https://help.hackerearth.com/assessments-recruiters?hsLang=en#approximate)
    - [Diagram](https://help.hackerearth.com/assessments-recruiters?hsLang=en#diagram)
    - [File upload](https://help.hackerearth.com/assessments-recruiters?hsLang=en#file-upload)
    - [Invites](https://help.hackerearth.com/assessments-recruiters?hsLang=en#invites)
    - [Reports](https://help.hackerearth.com/assessments-recruiters?hsLang=en#reports)
    - [Billing](https://help.hackerearth.com/assessments-recruiters?hsLang=en#billing)
    - [HackerEarth Reports: Admins, Tests, and Teams](https://help.hackerearth.com/assessments-recruiters?hsLang=en#hackerearth-reports-admins-tests-and-teams)
    - [Technical Content Updates](https://help.hackerearth.com/assessments-recruiters?hsLang=en#technical-content-updates)
- [FaceCode](https://help.hackerearth.com/facecode?hsLang=en#main-content)

    - [FaceCode and its features](https://help.hackerearth.com/facecode?hsLang=en#facecode-and-its-features)
    - [Scheduling interviews on FaceCode](https://help.hackerearth.com/facecode?hsLang=en#scheduling-interviews-on-facecode)
- [Assessments: ATS integrations](https://help.hackerearth.com/assessments-ats-integrations?hsLang=en#main-content)

    - [Integration](https://help.hackerearth.com/assessments-ats-integrations?hsLang=en#integration)
    - [iCIMS](https://help.hackerearth.com/assessments-ats-integrations?hsLang=en#icims)
    - [Zoho Recruit](https://help.hackerearth.com/assessments-ats-integrations?hsLang=en#zoho-recruit)
    - [SmartRecruiters](https://help.hackerearth.com/assessments-ats-integrations?hsLang=en#smartrecruiters)
    - [EightFold](https://help.hackerearth.com/assessments-ats-integrations?hsLang=en#eightfold)
    - [SuccessFactors](https://help.hackerearth.com/assessments-ats-integrations?hsLang=en#successfactors)
    - [Greenhouse](https://help.hackerearth.com/assessments-ats-integrations?hsLang=en#greenhouse)
    - [Lever](https://help.hackerearth.com/assessments-ats-integrations?hsLang=en#lever)
    - [Linkedin Talent Hub](https://help.hackerearth.com/assessments-ats-integrations?hsLang=en#linkedin-talent-hub)
    - [JazzHR](https://help.hackerearth.com/assessments-ats-integrations?hsLang=en#jazzhr)
    - [Workable](https://help.hackerearth.com/assessments-ats-integrations?hsLang=en#workable)
    - [Recruiterbox - Trakstar Hire](https://help.hackerearth.com/assessments-ats-integrations?hsLang=en#recruiterbox-trakstar-hire)
    - [Jobvite](https://help.hackerearth.com/assessments-ats-integrations?hsLang=en#jobvite)
    - [Ashby](https://help.hackerearth.com/assessments-ats-integrations?hsLang=en#ashby)
- [Assessments: Product updates](https://help.hackerearth.com/assessments-product-updates?hsLang=en#main-content)

    - [Release notes: HackerEarth Assessment](https://help.hackerearth.com/assessments-product-updates?hsLang=en#release-notes-hackerearth-assessment)
    - [Root Cause Analysis (RCA)](https://help.hackerearth.com/assessments-product-updates?hsLang=en#root-cause-analysis-rca)
    - [Content updates](https://help.hackerearth.com/assessments-product-updates?hsLang=en#content-updates)
- [Assessments: Best practices](https://help.hackerearth.com/assessments-best-practices?hsLang=en#main-content)

    - [Recruit](https://help.hackerearth.com/assessments-best-practices?hsLang=en#recruit)
- [SSO](https://help.hackerearth.com/sso?hsLang=en#main-content)

    - [SSO](https://help.hackerearth.com/sso?hsLang=en#sso)
- [Upskilling](https://help.hackerearth.com/upskilling?hsLang=en#main-content)

    - [Introduction: Upskilling](https://help.hackerearth.com/upskilling?hsLang=en#introduction-upskilling)
- [Assessments: Candidates](https://help.hackerearth.com/assessments-candidates?hsLang=en#main-content)

    - [Getting started](https://help.hackerearth.com/assessments-candidates?hsLang=en#getting-started)
    - [Test environment](https://help.hackerearth.com/assessments-candidates?hsLang=en#test-environment)
    - [Question types](https://help.hackerearth.com/assessments-candidates?hsLang=en#question-types)
    - [FaceCode](https://help.hackerearth.com/assessments-candidates?hsLang=en#facecode)
    - [Feedback and queries](https://help.hackerearth.com/assessments-candidates?hsLang=en#feedback-and-queries)
- [Problem setting for HackerEarth](https://help.hackerearth.com/problem-setting-for-hackerearth?hsLang=en#main-content)

    - [Rate cards](https://help.hackerearth.com/problem-setting-for-hackerearth?hsLang=en#rate-cards)
- [Campus](https://help.hackerearth.com/campus?hsLang=en#main-content)

    - [Recruiters](https://help.hackerearth.com/campus?hsLang=en#recruiters)
    - [Recruiter FAQs](https://help.hackerearth.com/campus?hsLang=en#recruiter-faqs)
    - [Candidate FAQs](https://help.hackerearth.com/campus?hsLang=en#candidate-faqs)
- [Hackathons and Hiring Challenges](https://help.hackerearth.com/hackathons-and-hiring-challenges?hsLang=en#main-content)

    - [Hackathons](https://help.hackerearth.com/hackathons-and-hiring-challenges?hsLang=en#hackathons)
    - [Hiring challenges](https://help.hackerearth.com/hackathons-and-hiring-challenges?hsLang=en#hiring-challenges)
- [Frequently Asked Questions (FAQs)](https://help.hackerearth.com/frequently-asked-questions-faqs?hsLang=en#main-content)

    - [Assessments: Recruiters](https://help.hackerearth.com/frequently-asked-questions-faqs?hsLang=en#assessments-recruiters)
    - [GDPR compliance (Candidates)](https://help.hackerearth.com/frequently-asked-questions-faqs?hsLang=en#gdpr-compliance-candidates)
    - [GDPR compliance (Recruiters)](https://help.hackerearth.com/frequently-asked-questions-faqs?hsLang=en#gdpr-compliance-recruiters)
    - [General](https://help.hackerearth.com/frequently-asked-questions-faqs?hsLang=en#general)
    - [Assessments: Candidates](https://help.hackerearth.com/frequently-asked-questions-faqs?hsLang=en#assessments-candidates)
    - [HackerEarth Vs ChatGPT](https://help.hackerearth.com/frequently-asked-questions-faqs?hsLang=en#hackerearth-vs-chatgpt)
- [Profiles](https://help.hackerearth.com/profiles?hsLang=en#main-content)

    - [Profiles - Recruiter](https://help.hackerearth.com/profiles?hsLang=en#profiles-recruiter)
- [OnScreen](https://help.hackerearth.com/onscreen?hsLang=en#main-content)

    - [OnScreen - Interview templates](https://help.hackerearth.com/onscreen?hsLang=en#onscreen-interview-templates)
    - [OnScreen - Sending Invites](https://help.hackerearth.com/onscreen?hsLang=en#onscreen-sending-invites)
    - [OnScreen - Download reports](https://help.hackerearth.com/onscreen?hsLang=en#onscreen-download-reports)
    - [OnScreen - Interview Analytics](https://help.hackerearth.com/onscreen?hsLang=en#onscreen-interview-analytics)
    - [OnScreen - Overview](https://help.hackerearth.com/onscreen?hsLang=en#onscreen-overview)
    - [OnScreen - Interview Proctoring Settings](https://help.hackerearth.com/onscreen?hsLang=en#onscreen-interview-proctoring-settings)

[![Chill listening crop-3](https://help.hackerearth.com/hs-fs/hubfs/HE%20Logo%20for%20sig-1.png?width=120&height=24&name=HE%20Logo%20for%20sig-1.png "Chill listening crop-3")](https://www.hackerearth.com/)

Copyright © 2026, HackerEarth