# How to put OR statements in if Functions with strings

 Ash Marz · June 29, 2015 `` float fahrenheit;    float celsius;    char str[20];    printf("Choose either fahrenheit or celsius: \n ");    scanf("%s",str);    printf("%s: \n", str);    if (strcmp(str, "fahrenheit" || "Fahrenheit" || "FAHRENHEIT") ==0)    {        printf("Enter the temperature in fahrenheit: ");        scanf("%f", &fahrenheit);        float formulaf = (fahrenheit - 32.0) * 5.0/9.0;        printf("%.2f fahrenheit is %.2f celsius", fahrenheit, formulaf);    }    else if (strcmp(str, "celsius") ==0)    {        printf("Enter the temperature in celsius: ");        scanf("%f", &celsius);        float formulac = celsius * 9.0/5.0 + 32.0;        printf("%.2f celsius is %.2f fahqrenheit", celsius, formulac);    }    else    {        printf("Value is undefined");    }``Please help me solve this error if (strcmp(str, "fahrenheit" || "Fahrenheit" || "FAHRENHEIT") ==0)

## Replies

 PRASOON PANDEY · June 29, 2015 Use this-if (strcmp(str , "fahrenheit") || strcmp(str , "Fahrenheit") || strcmp(str, "FAHRENHEIT") ==0) c student · June 29, 2015 make a function to make everything lowercase.  it's much better that way. Ash Marz · June 29, 2015 Thanks for the help, could you tell me how to a lowercase function? c student · June 30, 2015 ``for the length of the string if character is uppercase, make lowercase``find a method to make uppercase into lowercase
• 1

## C

129,691 followers