Question
Write a simple Windows program to print “Hello World".

Answers

Here is a simple Windows program written in C++ that will print "Hello World" to the console:

#include

int main()
{
std::cout << "Hello World" << std::endl;
return 0;
}

To run this program, you will need a C++ compiler such as Microsoft Visual C++. Here are the steps to compile and run the program:

Open Microsoft Visual C++ and create a new project.
In the project, create a new source file and copy the above code into it.
Save the file and build the project.
Run the project to see the output.
Alternatively, you can use a text editor such as Notepad to write the code and save it as a .cpp file. Then, you can use the command line to compile and run the program using the following commands:

Open the command prompt.
Navigate to the directory where the .cpp file is saved.
Compile the program using the command "g++ filename.cpp -o filename".
Run the program using the command "filename.exe".
This will compile the program and display the output "Hello World" in the console window.   Your Comment






Search
Can you Answer!!
  • Q Name 5 JDBC best practices your follow?
  • Q Which gas is used for converting vegetable oils into saturated fats –
  • Q The snake crept into a _______ :
  • Q What is the size of a reference variable?
  • Q What animals head appears on the label of Gordon's Gin
  • Q Which features are must-have versus nice-to-have?
  • Q To perform a merge on multiple datasets, what are the conditions to perform a merge?
  • Q The song 'Vandematharam..." is included in a novel. Name the novel.
  • Q What is the disadvantage of a template function?
  • Q Who was the President of the Indian National Congress at the time of Indian Independence?
  • Q What's the Synchronization?