Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » beginner's input/output problem..(input/output)
icon8.gif  beginner's input/output problem.. [message #754828] Fri, 04 November 2011 13:49 Go to next message
platon123 is currently offline platon123Friend
Messages: 3
Registered: November 2011
Junior Member
Hey,
I made a very simple program:

#include <stdio.h>

int main()
{


int a;

printf("Enter size of input:\n");
scanf("%d",&a);
if (!(a>0))
{
printf("Invalid size");
return 0;
}
printf("%d",a);
}

Now, when I run it, the console window is empty.
After I enter a number (for instance, 5) and press Enter, it shows:

5
Enter size of input:
5

So it works, but why doesn't the text show up when it's supposed to? how can I fix it?
Thanks in advance!
Re: beginner's input/output problem.. [message #754911 is a reply to message #754828] Fri, 04 November 2011 21:36 Go to previous messageGo to next message
Archangel  is currently offline Archangel Friend
Messages: 2
Registered: November 2011
Junior Member
I have same problem. ı wrote this code as at the down...

#include <stdio.h>

int main(void) {

int number1;
int number2;
int sum;

printf("Enter the first number\n");
scanf("%d",&number1);

printf("Enter the second number\n");
scanf("%d",&number2);

sum=number1+number2;

printf("%d\n",sum);

return 0;
}

5
6
Enter the first number
Enter the second number
11

firstly program wanted numbers and after that ıt wrote the printf function...
ıs there any one who can help???
Re: beginner's input/output problem.. [message #754925 is a reply to message #754911] Sat, 05 November 2011 05:52 Go to previous messageGo to next message
Archangel  is currently offline Archangel Friend
Messages: 2
Registered: November 2011
Junior Member
planton could you solve the problem??
Re: beginner's input/output problem.. [message #754943 is a reply to message #754925] Sat, 05 November 2011 16:21 Go to previous messageGo to next message
platon123 is currently offline platon123Friend
Messages: 3
Registered: November 2011
Junior Member
No, Confused ..
It's strange that no one addresses this. I/O is like the first thing you want to get right..
Anyone??
Re: beginner's input/output problem.. [message #756058 is a reply to message #754943] Thu, 10 November 2011 17:15 Go to previous messageGo to next message
Nobody Mising name is currently offline Nobody Mising nameFriend
Messages: 75
Registered: July 2010
Member
platon123 wrote on Sat, 05 November 2011 12:21
No, Confused ..
It's strange that no one addresses this. I/O is like the first thing you want to get right..
Anyone??

Just read the FAQ: http://wiki.eclipse.org/CDT/User/FAQ#Eclipse_console_does_not_show_output_on_Windows
Re: beginner's input/output problem.. [message #757623 is a reply to message #756058] Sun, 20 November 2011 15:12 Go to previous message
platon123 is currently offline platon123Friend
Messages: 3
Registered: November 2011
Junior Member
Sorry for the delay, but thanks!!!
Previous Topic:Remote connection closed after "list-thread-groups"
Next Topic:lua
Goto Forum:
  


Current Time: Tue Apr 23 07:11:09 GMT 2024

Powered by FUDForum. Page generated in 0.05770 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top