I am trying to make a script which will need an integer as user input.
<code>printf("What is your guess?n--> ");
int guess;
scanf("%d", &guess);
</code>
<code>printf("What is your guess?n--> ");
int guess;
scanf("%d", &guess);
</code>
printf("What is your guess?n--> ");
int guess;
scanf("%d", &guess);
But when I try to run and compile it using gcc in vscode, the code doesn’t stop running and doesn’t output anything. When I use ctrl+c it says code=null.
When I do it via my terminal, it works just fine.
What am I doing wrong?
I have looked on other articles, but they didn’t seem to help.
New contributor
Victor De coole is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.