My code doesn't take the input of a character in on online C compiler at "programiz.com".
#include <stdio.h>
int main(){
int a;
float b;
char ch;
char str[100];
printf("Enter an integer : ");
scanf("%d",&a);
printf("Enter a decimal number : ");
scanf("%f",&b);
printf("Enter a character : ");
scanf("%c",&ch);
printf("Enter a string : ");
fflush(stdin);
fgets(str,100,stdin);
}
It directly jumps from taking decimal input to string, and I don't know why.