Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C# (http://www.go4expert.com/forums/c-sharp/)
-   -   HelloWorld program can compile but no output shown on console (http://www.go4expert.com/forums/helloworld-program-compile-output-shown-t22323/)

tech_girl 6Jun2010 10:36

HelloWorld program can compile but no output shown on console
 
Hi all,

I'm a C# beginner. Managed to download and set up the environment for C# programming. I have downloaded and installed the .Net Framework 2.0 and its corresponding SDK.

I compiled a HelloWorld program. No error was shown on the console so I believe it has compiled successfully but it doesn't show "Hello World".


C:\MyProgram>csc HelloWorld.cs
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.3053
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.


C:\MyProgram>


Can anyone shed light on this? Is this a setup issue?

shabbir 6Jun2010 13:05

Re: HelloWorld program can compile but no output shown on console
 
Share your code

tech_girl 6Jun2010 16:25

Re: HelloWorld program can compile but no output shown on console
 
Here is the code:

using System;
public class HelloWorld
{
public static void Main() {
Console.Write("Hello World!");
}
}

tech_girl 6Jun2010 16:27

Re: HelloWorld program can compile but no output shown on console
 
Here is the code:

using System;
public class HelloWorld
{
public static void Main() {
Console.Write("Hello World!");
}
}

tech_girl 6Jun2010 16:27

Re: HelloWorld program can compile but no output shown on console
 
Oops...apologies for the double post.

shabbir 6Jun2010 18:33

Re: HelloWorld program can compile but no output shown on console
 
And why are you trying to run the program using console. Do you have the Editor?

tech_girl 9Jun2010 12:01

Re: HelloWorld program can compile but no output shown on console
 
Issue resolved.

Yesterday I installed VS2005.


All times are GMT +5.5. The time now is 20:19.