HEy,
I am new to C# and dont know much about it. I am facing a problem while running my code in Visual Studio 2008. The problem is that the screen disappears immediately when the program ends. please help me. Thanks in advance.

Hello Maheed, welcome on this site.
Seems like you where trying to start what is called a Console application. You have to put as a last line of code a "read" statement, so that the console window stays on screen. I usually use Console.ReadKey();

HEy,
I am new to C# and dont know much about it. I am facing a problem while running my code in Visual Studio 2008. The problem is that the screen disappears immediately when the program ends. please help me. Thanks in advance.

As previously mentioned you are starting Console type application. Instead of using F5 for starting the project, try CTRL+F5. See what will happen.

If you're debugging, you can set a breakpoint on the last closing curly brace on your "Main" and it will allow you to see the output before the window closes.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.