I am writing a program to enter and display datatypes in C language. I can enter and display int,float,long double,but cannot enter and display char.
int a;
float b;
long double c;
char d;
printf("\nEnter the integer value");
scanf_s("%d", &a);
printf("\nThe integer value is %d", a);
printf("\nEnter the float value");
scanf_s("%f", &b);
printf("\nThe float value is %f", b);
printf("\nEnter the long double value");
scanf_s("%lf", &c);
printf("\nThe double value is %lf", c);
printf("\nEnter the char value");
scanf_s("%c", &d,1);
printf("\nThe char value is %c", d);