I want to write a string named output to the console screen. How do i do that?

string output= "hello world"

How can I write the output to the screen?

I want to write a string named output to the console screen. How do i do that?

string output= "hello world"

How can I write the output to the screen?

you can try this , which is the first to learn writing to the console.

using System;
public class myfirstprogram
{
public static void Main()
{
Console.Write("HELLO WORLD");
}
}

you can try this , which is the first to learn writing to the console.

using System;
public class myfirstprogram
{
public static void Main()
{
Console.Write("HELLO WORLD");
}
}

Hey there,

This looks suspiciously like a homework post. That's why I posted a link rather than code.

Teach them to fish, don't just give them the fish. :)

Yes this board seems to attract students wanting someone else to do their homework.
Think about it, If you give them all the answers, and they end up with a degree in computer science, then get a job at your business, and end up on your team...you can only blame youself for doing all their homework. They will be worthless to a programming team unless they actually put in the time, and learn this stuff.

Please stop posting homework assignments. Ask questions on the why, and how, but don't expect us to do your homework for you.


Teach them to fish, don't just give them the fish. :)

whats the fun in that, then they wont come back begging for more :P

I'm amazed if that's homework, that's page 1 paragraph 2 of any C# book... Hello world homework, eh... I wish my first C# class gave me homework like that!!

hi,

string str="good";
Console.WriteLine(str);
Console.Read();

Regards,
Narra.

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.