int getLatitude(void) {
return rand() % 181 - 90;
}
srand(42);
int latitude = getLatitude();
//latitude is from -90 to 90
//without braces the branch is one statement only
const char *location = "";
if (latitude == 0)
location = "Equator";
else if (latitude == 90)
location = "north Pole";
else if (latitude == -90)
location = "south Pole";
else
location = "not at the Equator or Pole";
printf("latitude is %d\n", latitude);
printf("location is %s\n", location);