1. ## Noobie Code Help

Hello all this is my first post, I know i'm not supposed to just ask for answers so i given it a solid go and I'm stumped, i don't know all that much so i'm sure its a few little things but any help would be great. Here's what i'm supposed to be doing and what I've got.

Write a program in C to calculate the insurance premium for a building (house) insurance. The premium depends on the amount insured and also has a processing charge of \$50. Customers are charged 0.3% of the amount insured, where the insured amount is less than \$100,000, and 0.25% for other amounts. Customers that have zero claims receive a 10% reduction in their total premium as a no claim bonus. The amount insured is always a multiple of \$1000.

Code:
```#include <stdio.h>

int main()
{
printf("Input amount insured:");
scanf(" %d", &amountinsured);
printf("Input number of claims:");
scanf(" %d", &numberofclaims);

if (amountinsured<100000)
{
}
else
{
}

printf("Amount Insured:%d\n",amountinsured);
printf("Number of Claims:%d\n",numberofclaims);
if (numberofclaims = 0)
{
printf("No claim bonus:%d\n",noclaimbonus);
}
return 0;
}```

2. Code:
`if (numberofclaims = 0)`
This is asignement. Use ==

Kurt

3. Originally Posted by ZuK
Code:
`if (numberofclaims = 0)`
This is asignement. Use ==

Kurt
Well that's one thing i missed, problem is it doesn't work properly before it gets to that, I'm getting much to high a number for the premium and i don't know why.

4. premium is an int, but you appear you want a floating point variable, e.g., of double type.

5. Originally Posted by laserlight
premium is an int, but you appear you want a floating point variable, e.g., of double type.
Yeah that was it, thank you so much