-2

I tried to use a string instead of a char but the string works fine, I'm still confused why can't I use a char for the 2nd scanf

    #include <stdio.h>
    #include <stdlib.h>
    void main()
    {
        char customer_code, service;
        
    
        printf("\n\nConsumer Type: ");
        scanf("%c", &customer_code);
        
        printf("\nis this your first time using our services? [Y/N] ");
        scanf("%c", &service);
    }

1 Answers1

-1

try it

   #include <stdio.h>
   #include <stdlib.h>
   int main()
   {
    char customer_code, service;
    

    printf("\n\nConsumer Type: ");
    scanf("%c", &customer_code);
    getchar();
    printf("\nis this your first time using our services? [Y/N] ");
    scanf("%c", &service);
    }
lavantho0508
  • 125
  • 10