Q:

If - else Program

Hi I have this code here trying ask the user about the location.When the user enters the location it just says bye.What is wrong in my code?
#include<stdio.h>

int main ()
{

        char location[15];
        printf("1:Greencourt\n");
        printf("2:Corianthans\n");
        printf("3:Shop\n");
        printf("Enter a location\n");
        scanf("%s",location);
        if(location=="Greencourt")
        printf("Bisleri bottle cost 25 rupees\n");
        else
        if(location=="Shop")
        printf("Bisleri bottle cost 15 rupees\n");
        else
        if(location=="Corianthans")
        printf("Bisleri bottle cost 50\n");
        else
        printf("Bye");

        return 0;
}

Here is the output
1:Greencourt
2:Corianthans
3:Shop
Enter a location

Shop

Bye

A:

You are comparing strings (array of char) you can't use '==' operator.
You should use strcmp function:
int strcmp(const char *str1, const char *str2)

so:
if(strcmp(location,"Greencourt") == 0)

