How to reduce chance of RE

I have many times got RE in solving problems in programming.
I only know that we get RE because when we divide something by 0 or using much memory.
Can someone can tell me other reasons of getting RE.
Thank’s.

1 Like

There are some possible reasons behind the runtime error

  1. An infinite loop
  2. Memory limit exceeded
  3. An array out of bounds
  4. Dividing by 0

Hope this helped you, feel free to comment and ask.

EDIT: out of bounds means you declare an array of size 5 like
“int a[5];”
and you are trying to store 6 elements in it. Or a long long integer in it.

1 Like

@crackerscode There are four types of runtime error, and you can know the type of error you are getting by hovering on the RE icon, and once you know the type of error your program have encountered, you can know the reason here.

2 Likes

see the edited answer

I am only getting RE for some taste casses

how can i know is my program is having memory limit exceed.How can i check?

That’s why it’s showing Runtime error.