I am getting these error messages -
radarprog.c: In function 'main':
radarprog.c:23: error: parse error before 'else'
radarprog.c:30: error: parse error before 'else'
radarprog.c:37: error: parse error before 'else'
radarprog.c: At top level:
radarprog.c:42: error: parse error before 'return'
I am messing something up, so what is wrong with the "else if" statements? How am I not conforming to the syntax? Please bare with me if this seems silly, as it is only my second week (actually the 2nd starts tomorrow).. so please be kind!
Thanks in advance!
Here is the code -
/*****************************************************************
Author: Nate
Date: 17/02/09
Purpose: Speed Radar and Fine calculation
*****************************************************************/
#include <stdio.h>
int main()
{
int speed;
printf( "Please enter the speed: ");
scanf( "%d", &speed );
/* State if speeding*/
if(speed >59);
{
printf( "Speeding" );
}
/* State fine for 1-10 khm over" */
else if(speed >59 && <=69);
{
printf("1-10kmh over the limit, fine is $80");
}
/* Stae fine for 11-30 khm over" */
else if(speed >=70 && <=89);
{
printf("11-30kmh over the limit, fine is $150");
}
/* State fine for 30+ khm over" */
else(speed >=90);
{
printf("30kmh or over the limit, fine is $500");
}
return(0);
}


Sign In
Create Account


Back to top










