You are not logged in. Please login at www.codechef.com to post your questions!

×

SIGFPE Runtime Error.

Can someone please tell me when does one get SIGFPE runtime error. I'm pretty sure i'm not dividing by zero at any point in my code.

asked 10 Jul '14, 22:21

subhendu_sethi's gravatar image

5★subhendu_sethi
1112
accept rate: 0%

edited 10 Jul '14, 22:45


On gcc -W and -Wall turn on different sets of warnings, so both of them are necessary.

For more Visit: Innovative Apps Here..

link

answered 10 Jul '14, 22:34

elizabeth_keen's gravatar image

0★elizabeth_keen
16
accept rate: 0%

can you please elaborate. i'm a newbie. also can you tell me about the different set of warnings.

(11 Jul '14, 11:52) subhendu_sethi5★

Hi. Could you please give a link to your code so we can see the code. It is difficult to say anything without that.

link

answered 11 Jul '14, 15:21

kcahdog's gravatar image

3★kcahdog
10.0k2854129
accept rate: 14%

include <iostream>

using namespace std;

int main() { int count,i,a; unsigned int inputNumber; int cnt[10];

cin>>count;

for(i = 0;i<count;i++)
{
    cin>>inputNumber;
    cnt[i] = 0;
    a = 5;
    while(a < inputNumber)
    {
        cnt[i] = cnt[i] + inputNumber/a;
        a = a * 5; 
    }
}

for (int j = 0; j < i; j++)
{
    cout<<"\n"<<cnt[j];
}

return 0;

}

I am getting run time error .... where is my mistake .... i m not getting ??????

link

answered 13 Jul '14, 00:39

infinitydon's gravatar image

1★infinitydon
1
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×42
×19
×14
×11

question asked: 10 Jul '14, 22:21

question was seen: 4,837 times

last updated: 13 Jul '14, 00:39