syntax error at end of input
Can someone please tell we where the error in this code is i keep getting an error on the last line saying "syntax error at end of input" need help quick please.
Code:
int main()
{
// Welcome message
printf("Welcome to RoboSimoClient\n\n");
// Ask user for server IP address, then connect to it
int counter;
int a, b, c, d, port;
printf("Please enter server IP address: ");
scanf("%d.%d.%d.%d", &a, &b, &c, &d);
printf("Please enter port number: ");
scanf("%d", &port);
connect_to_server(a, b, c, d, port);
// circle the arena
while(1)
{
set_motor_speeds(100,100);
counter = 1;
while(read_analog_channel(0) < 120 && read_analog_channel(1) < 120);
{
set_motor_directions(1, 1);
}
set_motor_directions(0, 0);
if(read_analog_channel(0) > 120 && read_analog_channel(1) < 120);
{
while(counter > 0);
{
if(read_analog_channel(0) > 120 && read_analog_channel(1) < 120)
{
set_motor_directions(1, 0);
}
else
{
set_motor_directions(1, 1);
}
counter = counter + 1;
}
if(read_analog_channel(0) < 120 && read_analog_channel(1) > 120);
{
while(counter > 0);
{
if(read_analog_channel(0) < 120 && read_analog_channel(1) > 120)
{
set_motor_directions(0, 1);
}
else
{
set_motor_directions(0, 0);
}
counter = counter + 1;
}
}
return 1;
}