#include <stdio.h>
void main()
{
int i;
float bal=120;
//printf("Enter the amt to be withdrawed");
scanf("%d",&i);
if((i%5)==0)
{
if(i<bal)
bal=bal-i-0.5;
}
printf("%f",bal);
}
#include <stdio.h>
void main()
{
int i;
float bal=120;
//printf("Enter the amt to be withdrawed");
scanf("%d",&i);
if((i%5)==0)
{
if(i<bal)
bal=bal-i-0.5;
}
printf("%f",bal);
}
You are getting NZEC runtime error, that means you are not returning 0 (return type for main has to be int) at the end, you can read more in FAQ, section “Why do I get an NZEC”, there is list of other common errors
I saw that you tried also Java (sabarish | CodeChef User Profile for Sabarish Subramanian | CodeChef), paste a link to your solution, I’ll help you