Programs with the scanf not working properly in NetBeans

cnetbeansscanf

I've installed NetBeans 7.0.1 today When I try to execute C program with "scanf" in it it's giving strange errors

This is what I wrote:

Program

It keeps on running until I enter something in the output console.
enter image description here

After entering its shows the printf statement and shows "RUN FAILED"

enter image description here

Can anybody tell me what should I do to make this right?

Best Answer

Yes, I have same problem with you, and the solutions in answers are not working on my machine. After searching, I understand that this problem is about Netbean's internal terminal/console section. The internal console is not able to run scanf function. So use external terminal for your project. To do this:

  • first right click on your project, and select properties.
  • In that window select "Run" tab at the bottom.
  • in there, there is "Console Type", change this console type from "internal terminal" to "external terminal".

That is all.

Related Topic