Need help with my C program

I am new to coding, and I made this program it doesnt work properly. When I run program and type a country it only print first function that it is in Europe. Even if I type USA for example it says it is in Europe…How can I fix this?

#include <stdio.h>
#include <stdlib.h>

int main()
{
    char EU[1000]={'United Kingdom','Germany','France','Italy','Spain','Portugal','Poland','Sweden','Norway','Denmark','Iceland','Ireland','Ukraine','Finland','Romania','Belarus','Greece','Bulgaria','Hungary','Serbia','Austria','Czechia','Ireland','Lithuania','Latvia','Croatia','Bosnia and Herzegovina','Slovakia','Estonia','Switzerland','Netherlands','Moldova','Belgium','Albania','North Macedonia','Slovenia','Montenegro','Kosovo','Luxembourg','Andorra','Malta','Liechtenstein','San Marino','Monaco','Vatican City'};

    char AS[1000]={'China','Japan'};

    char AF[1000]={'Morroco'};

    char NA[1000]={'USA','Canada','Mexico','Cuba','Guatemala','Haiti','Dominican Republic','Honduras','Nicaragua','El Salvador','Costa Rica','Jamaica','Trinidad and Tobago','Belize','Bahamas','Barbados','Saint Lucia','Grenada','Saint Vincent and the Grenadines','Antigua and Barbuda','Dominica','Saint Kitts and Nevis'};

    char SA[1000]={'Brazil'};

    char OC[100]={'Australia','New Zealand','Papua New Guinea','Indonesia','Tuvalu','Nauru'};

    char AN[10]={'Antarctica'};

    char EU_AS[20]={'Turkiye','Russia'};

    char AS_AF[10]={'Egypt'};

    char NA_SA[10]={'Panama'};               //   {'',''};

    printf("**Choose a country and type its name...\n");
    printf("Type here: ");
    scanf("%s");

    if(EU[1000])
        {
            printf("\nThe Country you choose is in Europe!\n");
        }
    else if(AS[1000])
        {
            printf("\nThe Country you choose is in Asia!\n");
        }
    else if(AF[1000])
        {
            printf("\nThe Country you choose is in Africa!\n");
        }
    else if(NA[1000])
        {
            printf("\nThe Country you choose is in North America!n");
        }
    else if(SA[1000])
        {
            printf("\nThe Country you choose is in South America!n");
        }
    else if(OC[100])
        {
            printf("\nThe Country you choose is in Oceania!n");
        }
    else if(AN[10])
        {
            printf("\nThe Country you choose is in Antarctica....,Wait a minute.. its actually just a continent!\n");
        }
    else if(EU_AS[20])
        {
            printf("\nThe Country you choose is transcontinental, it has borders both in Europe and Asia!\n");
        }
    else if(AS_AF[10])
        {
            printf("\nThe Country you choose is transcontinental, it has borders both in Asia and Africa!\n");
        }
    else if(NA_SA[10])
        {
            printf("\nThe Country you choose is transcontinental, it has borders both in North America and South America!\n");
        }
    else
        {
            printf("\nThe statement you typed is either invalid or does not included in the program when is written.\n");
        }

    return 0;
}

try to understand what your if condition is saying.
One way to understand is to try to print out what EU[1000] will give you.
(what do you think it will give you?)

Make sure you understand that if statements work by checking a condition. If a condition is true, then the statement will be executed, otherwise the else will be executed. We can assume that if(EU[1000]) always returns true. But why?
(why should it ever return false is another way of asking that)

This isn’t the way to use scanf

Can you show me the right way?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.