HTML & JS
// C program to demonstrate the problem when
// fgets()/gets() is used after scanf()
#include<stdio.h>

int main()
{
int x;
char str[100];
scanf("%d\n", &x);
fgets(str, 100, stdin);
printf("x = %d, str = %s", x, str);
return 0;
}

Generated URL:

Output:

x = 10, str = test
Report Bug