I can't understand why this code is not working properly:
#include<stdio.h>
int main()
{
char string [100];
int a;
printf(">");
scanf("%d", &a);
printf(">");
gets(string);
printf("%s\n", string);
}
This is a little part from a program that I had to build and I can't understand why after getting the value into a by scanf() function, the program just skip or not reading properly the string by gets() function. If you copy the code into compiler and tries to run you will understand what I mean.