ATM problem showing runtime error

#include <stdio.h>
int main()
{
int wi;
float ab;
scanf("%4d%4.2f", &wi, &ab);
if(ab>wi&&(wi%5==0))
printf("%4.2f", (ab-wi-0.5));
else
printf("%4.2f", ab);
}

i don’t know why it is showing runtime error. i tested it with the examples, and they are working.

ur main function should be returning an integer .return 0

1 Like

the main function must return an integer at the end. for more info about runtime error refer to this link http://www.codechef.com/wiki/faq#Why_do_I_get_a_Runtime_exception

u missed this condition (ab-wi-0.50>0) …

//