Q:

String comparision in if statement generates some warnings

I'm trying to make a calculator, but my if statement generates some warnings. I am also new to C.
int main(){

    float num1;
    float num2;

    char input[5];

    printf("Hello my name is baymax\n");
    printf("Enter either add, sub, mult, div:\n");
    scanf("%4s", input);

    printf("Enter first number\n");
    scanf("%f", &num1);

    printf("Enter second number\n");
    scanf("%f", &num2);

    if(input == 'add'){
        printf("%.1f + %.1f = %.1f",num1, num2, num1+num2);
    ....
    }
    return 0;
}

If the string entered is add, it should add the two numbers. But I get the following warnings when compiling:
calculator.c:19:14: warning: multi-character character constant [-Wmultichar]
        if(input == 'add'){
                    ^
calculator.c:19:11: warning: comparison between pointer and integer
      ('char *' and 'int')
        if(input == 'add'){

A:

You have two problems with that code: The first is that 'add' is a multi-character literal, and not a string. A string would use double-quotes like "add".
The second problem is that you can't use equality comparison to compare string, as that will compare the pointers and not the contents of the strings. To compare strings you need to use strcmp.
if (strcmp(input, "add") == 0) { ... }

