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

×

ATM C Runtime Error

 #include <stdio.h>
    #include <stdlib.h>

    int main() {

        int WDAMT;
        float BAL;

        scanf("%d",&WDAMT);
        scanf("%f",&BAL);
            if(WDAMT%5 ==0 && (BAL-WDAMT) >= 0.5){
                printf("%.2f\n",BAL-WDAMT-0.5);
            }else
                printf("%.2f\n", BAL);

    }

Can any one suggest why the run time error is occuring

asked 04 Dec '13, 15:35

srikraj8341's gravatar image

0★srikraj8341
11
accept rate: 0%

edited 04 Dec '13, 15:55

kunal361's gravatar image

4★kunal361
6.0k133272


put "return 0;" at the end of ur code..i.e. in the main...but the last line...due to its absence u r getting a NZEC(non zero exit code) Run-time Error...hope this helps..:)

link

answered 04 Dec '13, 15:57

kunal361's gravatar image

4★kunal361
6.0k133272
accept rate: 21%

return statement is missing here, the compiler will produce a warning for it, you can check that by pressing F9 key...

link

answered 04 Dec '13, 18:19

rneha725's gravatar image

2★rneha725
313
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:

×1,477
×190

question asked: 04 Dec '13, 15:35

question was seen: 782 times

last updated: 04 Dec '13, 18:19