Method 1:
To print "Hello, World!" using C++ Language in Visual Code:-
Method 2:
To print "Hello, World!" using C++ Language in Visual Code:-
This program includes the iostream library, which provides the functionality to output text to the console. The cout
object is used to output the string "Hello, World!" and the endl
manipulator is used to insert a newline character after the string. The return 0;
at the end of the main
function indicates that the program has run successfully.
Method 3:
To print "Hello, World!" using C++ Language in Turbo C++:-
Here, #include<iostream.h> is header file which contains functions for input and output operations.
#include<conio.h> is a non-standard C++ header file that is not a part of the C++ Standard Library. It is a header file used in some C++ compilers, such as Turbo C++, Borland C++, and some versions of Visual C++, for console input/output operations.
The conio.h
header file contains several functions for input and output operations on the console, such as getch()
, getche()
, putch()
, and clrscr()
.
clrscr() is used to clear the console screen.
cout is used to print output that is "Hello,World!".
endl is used to add a new line after the message is printed.
getch() is used to read a character from the console without echoing it to the screen
Finally, the program returns 0, which is a standard convention to indicate that the program has executed successfully.
0 Comments