Friday, July 30, 2021

C Program for multi symptoms using string comparison

 


#include <stdio.h>

int main()

{

    char syma[10];

    char symb[20];

    char symc[30];

    char symd[40];

    int covid,covid1,covid2,covid3;

    printf("enter your symptoms:\n");

    scanf("%s%s%s%s",syma,symb,symc,symd);

    covid=strcmp(syma,"headache");

    covid1=strcmp(symb,"cold");

    covid2=strcmp(symc,"cough");

    covid3=strcmp(symd,"fever");

    if(covid==0)

    {

        printf("covid positive\n");

    }

else

{

    printf("covid negative\n");

}

if(covid1==0)

{

    printf("covid positive\n");

}

else

{

    printf("covid negative\n");

}

if(covid2==0)

{

    printf("covid positive\n");

}

else

{

    ("covid negative\n");

}

if(covid3==0)

{

    printf("covid positive\n");

}

else

{

    printf("covid negative\n");

}

    return 0;

}



USD TO INR C++ PROGRAMMING

  NALLAMUTHU GOUNDER MAHALINGAM COLLEGE                                                 POLLACHI-642001                                     ...