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

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…:slight_smile:

3 Likes

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

2 Likes